-
Notifications
You must be signed in to change notification settings - Fork 11
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
v7.9.0 (CPD-11491) - Optional removal of console.log statements #112
Changes from 6 commits
608ccda
8fc9baf
a7c0a90
cf4c509
4b1933a
429d924
144650e
4e3f432
87e65e9
49aa7e4
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 |
---|---|---|
|
@@ -304,7 +304,8 @@ Here is the outline of the configuration options, descriptions of each are below | |
], | ||
jsDir, | ||
lintPaths, | ||
usePackageVersion | ||
usePackageVersion, | ||
stripDebug | ||
}, | ||
img: { | ||
imgDir, | ||
|
@@ -443,7 +444,7 @@ Will add a content hash to the JS and CSS filenames, generating a new filename i | |
|
||
Type: `boolean` | ||
|
||
Default is set to false, when set to true this will bundle a versioned css file e.g `'filename-[version].css'`. | ||
Default is set to `false`, when set to true this will bundle a versioned css file e.g `'filename-[version].css'`. | ||
|
||
|
||
### `js` | ||
|
@@ -506,7 +507,13 @@ Will add a content hash to the JS and CSS filenames, generating a new filename i | |
|
||
Type: `boolean` | ||
|
||
Default is set to false, when set to true this will bundle a versioned JS file e.g `'filename-[version].js'`. | ||
Default is set to `false`, when set to true this will bundle a versioned JS file e.g `'filename-[version].js'`. | ||
|
||
- #### `stripDebug` | ||
|
||
Type: `boolean` | ||
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. Should add the default type like some of the other options do above. |
||
|
||
Default is set to `true`. When set to false, this will prevent `console.log()` statements from being removed for production builds. **For non-production builds, this has no effect: you will still get debug statements even if you've set this to `true`.** | ||
|
||
|
||
### `img` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,8 @@ const ConfigOptions = () => { | |
}, | ||
jsDir: 'js', | ||
lintPaths: [''], | ||
usePackageVersion: false | ||
usePackageVersion: false, | ||
stripDebug: true | ||
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. Can you add the relevant unit tests to 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. Done in latest commit 👍 |
||
}, | ||
|
||
/** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@justeat/gulp-build-fozzie", | ||
"version": "7.8.0", | ||
"version": "7.9.0", | ||
"description": "Gulp build tasks for use across Fozzie modules", | ||
"main": "index.js", | ||
"author": "Damian Mullins <damian.mullins@just-eat.com> (http://www.damianmullins.com)", | ||
|
@@ -71,7 +71,7 @@ | |
"handlebars-helpers": "^0.10.0", | ||
"helper-markdown": "^1.0.0", | ||
"helper-md": "^0.2.2", | ||
"jest-cli": "^22.1.4", | ||
"jest-cli": "^21.2.1", | ||
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. For future reference, one of the issues with |
||
"merge-stream": "^1.0.1", | ||
"postcss-assets": "^5.0.0", | ||
"postcss-reporter": "^5.0.0", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ gulp.task('scripts:bundle', () => { | |
)) | ||
|
||
// if production build, rip out our console logs | ||
.pipe(gulpif(config.isProduction, | ||
.pipe(gulpif(config.isProduction && config.js.stripDebug, | ||
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. Might be a silly question but why do we need to have this new option? Shouldn't we strip console logs / debuggers from production code anyway? Or is there a reason we use them in production. 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. It's a request from the OrderWeb team. They want to have production type code with debug statements for when they release to QA. 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. One thing that would be worth adding is the ability to set this config variable through an environment variable. So something like 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. @ashleynolan Should I add that in this PR? Fixed in latest commit. |
||
stripDebug() | ||
)) | ||
|
||
|
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.
Looks like this one is also missing the default option..
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.
That's my bad, I can fix this in my PR as part of the original ticket unless @xander-marjoram wants to amend it here? :)
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.
@kevinrodrigues I'll fix it here, if you haven't already 👍