diff --git a/README.md b/README.md index adb8808..d207ee7 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,9 @@ Gulp powers the frontend build system. All the frontend assets (CSS, JS, images) | css | Pre-process SCSS to CSS.
Process SCSS to sourcemaps.
Post-process CSS with Autoprefixer. | | default | Run "clean" to force all site assets to be regenerated.
Run all specified tasks and linters (css, image, js). | | image | Optimize image files (JPG, PNG, GIF, SVG) using ImageOptim library. | -| js{ModuleName} | Compress JS without mangling (rewriting for shortness).
Concatenate into bundles.
Process JS to sourcemaps. | +| js{BundleName} | Compress JS without mangling (rewriting for shortness).
Concatenate into bundles.
Process JS to sourcemaps. | | lintCss | Lint CSS with "stylelint" module.
This runs in "default" and anytime a watched CSS file is changed. | -| lintJs | Lint JS with "jsHint" module.
This runs in "default" and anytime a watched JS file is | changed. +| lintJs | Lint JS with "ESLint" module.
This runs in "default" and anytime a watched JS file is | changed. | watch | Run "default" immediately.
Start watchers for appropriate tasks. | #### Install build tools diff --git a/gulp/config.js b/gulp/config.js index 48c7f48..dad573e 100644 --- a/gulp/config.js +++ b/gulp/config.js @@ -73,7 +73,7 @@ var task = { }, jsAppPost: { dest: path.assets + 'js/build', - file: 'module-app-post.min.js', + file: 'bundle-app-post.min.js', mapDest: '../map', notifyOptions: { title: 'JS: Module: App Post', @@ -114,7 +114,7 @@ var task = { }, jsAppPostDefer: { dest: path.assets + 'js/build', - file: 'module-app-post-defer.min.js', + file: 'bundle-app-post-defer.min.js', mapDest: '../map', notifyOptions: { title: 'JS: Module: App Post Defer', @@ -130,7 +130,7 @@ var task = { }, jsAppPre: { dest: path.assets + 'js/build', - file: 'module-app-pre.min.js', + file: 'bundle-app-pre.min.js', mapDest: '../map', notifyOptions: { title: 'JS: Module: App Pre', @@ -146,7 +146,7 @@ var task = { }, jsThing: { dest: path.assets + 'js/build', - file: 'module-thing.min.js', + file: 'bundle-thing.min.js', mapDest: '../map', notifyOptions: { title: 'JS: Module: Thing', diff --git a/gulpfile.js b/gulpfile.js index 41bd135..543fa19 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -96,14 +96,14 @@ function image () { // ============================================== -// JS Modules +// JS // ============================================== /** * @param {object} task - Task config object like `config.task.taskName` * @return {function} - See: https://github.com/gulpjs/gulp/issues/2039 */ -function createJsModule (task) { +function bundleJs (task) { return pipeline([ gulp.src(task.src, { sourcemaps: true }), uglify(task.uglifyOptions), @@ -113,10 +113,10 @@ function createJsModule (task) { ], errorFormatter); } -var jsAppPost = () => createJsModule(config.task.jsAppPost); -var jsAppPostDefer = () => createJsModule(config.task.jsAppPostDefer); -var jsAppPre = () => createJsModule(config.task.jsAppPre); -var jsThing = () => createJsModule(config.task.jsThing); +var jsAppPost = () => bundleJs(config.task.jsAppPost); +var jsAppPostDefer = () => bundleJs(config.task.jsAppPostDefer); +var jsAppPre = () => bundleJs(config.task.jsAppPre); +var jsThing = () => bundleJs(config.task.jsThing); // ==============================================