-
Notifications
You must be signed in to change notification settings - Fork 4
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
Fixing js minimization and removing sourcemaps in production #100
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ app.yaml | |
.DS_Store | ||
.publish/ | ||
.vscode/ | ||
deploy.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
}, | ||
conversations: { | ||
// count must be an integer | ||
fallbackConversationCount: 4873330, | ||
fallbackConversationCount: 5680775, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated 👍 |
||
}, | ||
}; | ||
})(window); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,29 +114,23 @@ gulp.task('scripts', gulp.series(() => | |
'./app/scripts/wst.js', | ||
'./app/scripts/config.js', | ||
'./app/scripts/lib/*.js', | ||
// './node_modules/carousel-js/dist/carousel.js', TODOCAROUSEL | ||
'./app/scripts/sections/*.js', | ||
'./app/scripts/main.js' | ||
]) | ||
], {base: './app/scripts/'}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not familiar with some of this specific gulp configuration, but running it locally it seems like it works 🤷 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had updated gulp in a previous PR. There was an issue with changing the relative paths of the js files if the |
||
.pipe($.newer('.tmp/scripts')) | ||
.pipe($.sourcemaps.init()) | ||
.pipe($.babel()) | ||
.pipe($.sourcemaps.write()) | ||
.pipe(gulp.dest('.tmp/scripts')) | ||
.pipe($.concat('main.min.js')) | ||
.pipe($.uglify({ preserveComments: 'some' })) | ||
// Output files | ||
.pipe($.size({ title: 'scripts' })) | ||
.pipe($.sourcemaps.write('.')) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure why this was running twice, but we don't need it for production deploys. |
||
.pipe(gulp.dest('dist/scripts')) | ||
.pipe(gulp.dest('./dist/scripts/')) | ||
)); | ||
|
||
// Scan your HTML for assets & optimize them | ||
gulp.task('html', gulp.series(() => { | ||
return gulp.src('app/**/*.html') | ||
.pipe($.useref({ | ||
searchPath: '{.tmp,app}', | ||
noAssets: true | ||
searchPath: '{.tmp,app}' | ||
})) | ||
|
||
// Minify any HTML | ||
|
@@ -216,7 +210,7 @@ gulp.task('generate-service-worker', gulp.series('copy-sw-scripts', () => { | |
})); | ||
|
||
// Build production files, the default task | ||
gulp.task('default', gulp.series('clean', 'styles', 'lint', 'html', 'scripts', 'images', 'copy', 'generate-service-worker')); | ||
gulp.task('default', gulp.series('clean', 'styles', 'lint', 'scripts', 'images', 'html', 'copy', 'generate-service-worker')); | ||
|
||
// Build and serve the output from the dist build | ||
gulp.task('serve:dist', gulp.series('default', () => | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, I like
lastest
as a word