Skip to content

Commit

Permalink
#1: rename “createJsModule()” to “bundleJs()” to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanfalkowski committed Mar 16, 2019
1 parent dbadd47 commit d3252f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ Gulp powers the frontend build system. All the frontend assets (CSS, JS, images)
| css | Pre-process SCSS to CSS.<br> Process SCSS to sourcemaps.<br> Post-process CSS with Autoprefixer. |
| default | Run "clean" to force all site assets to be regenerated.<br> 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).<br> Concatenate into bundles.<br> Process JS to sourcemaps. |
| js{BundleName} | Compress JS without mangling (rewriting for shortness).<br> Concatenate into bundles.<br> Process JS to sourcemaps. |
| lintCss | Lint CSS with "stylelint" module.<br> This runs in "default" and anytime a watched CSS file is changed. |
| lintJs | Lint JS with "jsHint" module.<br> This runs in "default" and anytime a watched JS file is | changed.
| lintJs | Lint JS with "ESLint" module.<br> This runs in "default" and anytime a watched JS file is | changed.
| watch | Run "default" immediately.<br> Start watchers for appropriate tasks. |

#### Install build tools
Expand Down
8 changes: 4 additions & 4 deletions gulp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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',
Expand Down
12 changes: 6 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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);


// ==============================================
Expand Down

0 comments on commit d3252f6

Please sign in to comment.