This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require("path"); | |
const CopyPlugin = require("copy-webpack-plugin"); | |
module.exports = { | |
entry: "./src/index.tsx", | |
mode: "production", | |
module: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function App() { | |
return ( | |
<div> | |
<header> | |
<h5>Hello From React App 👋</h5> | |
</header> | |
</div> | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<nav></nav> | |
<header></header> | |
<footer></footer> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<div class="nav"></div> | |
<div class="header"></div> | |
<div class="footer"></div> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
"https://medium.com/p/e5e9b232d990/edit", | |
// ... | |
].forEach(url => { | |
describe(`GIVEN I provide the url '${url}'`, () => { | |
it("THEN the url is blacklisted", async () => { | |
const isBlackListed = await urlIsBlacklisted(url); | |
expect(isBlackListed).toEqual(true); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function playVideoWhenInViewport(videoElement: HTMLVideoElement) { | |
const viewportObserver = new IntersectionObserver( | |
(entries, _observer) => { | |
const videoIsVisible = entries[0].isIntersecting; | |
if (videoIsVisible) { | |
videoElement?.play(); | |
} | |
}, | |
{ | |
root: document |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location ~ ^/.*(woff|otf|jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp3|mp4|ogg|ogv) { | |
root /var/www/web-highlights; | |
gzip_static on; | |
expires 1y; | |
etag off; | |
if_modified_since off; | |
add_header Cache-Control "public, no-transform"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location / { | |
root /var/www/web-highlights; | |
try_files $uri /index.html; | |
gzip_static on; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins: [ | |
new CompressionPlugin(), | |
// ... | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const router = new Router({ | |
mode: "history", | |
base: "/", | |
routes: [ | |
{ | |
path: "/", | |
component: () => import(`./views/LandingPage.vue`) | |
}, | |
{ | |
path: "/home", |