Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web vitals #952

Merged
merged 10 commits into from
Jul 6, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
compiled js bundle
  • Loading branch information
max-ostapenko committed Jul 4, 2020
commit 2717a8db48265d86d8b9e6c4ef719c9662f5d62d
26 changes: 26 additions & 0 deletions src/static/js/bundle.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
gtag('js', new Date());
gtag('config', 'UA-22381566-3');
</script>
<script defer src="/static/js/bundle.js" nonce="{{ csp_nonce() }}"></script>
tunetheweb marked this conversation as resolved.
Show resolved Hide resolved
<link rel="shortcut icon" href="/static/images/favicon.ico">
<link rel="apple-touch-icon" href="/static/images/apple-touch-icon.png">
<link rel="stylesheet" href="/static/css/normalize.css?v=20200630133215">
Expand Down
15 changes: 15 additions & 0 deletions src/tools/generate/generate_js_bundle.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const browserify = require('browserify');
const fs = require('fs-extra');

const generate_js_bundle = async () => {
browserify(['./tools/generate/web-vitals.js'])
.transform('babelify', {
presets: ['@babel/preset-env'],
})
.bundle()
.pipe(fs.createWriteStream('./static/js/bundle.js'));
};

(async () => {
await generate_js_bundle();
})();