-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
feat: add include
and exclude
options (options.include|options.exclude
)
#82
Conversation
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.
👍 Very nice
src/index.js
Outdated
@@ -14,6 +15,7 @@ class CompressionPlugin { | |||
this.compressionOptions = {}; | |||
|
|||
if (typeof this.algorithm === 'string') { | |||
// eslint-disable-next-line global-require |
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.
Please always move eslint-disable
stuff to the top of the particular file :)
/* eslint-disable
* global-require,
* more rules...,
*/
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.
@michael-ciniawsky i think it is bad practice because disable rule on all file can provoke errors in places where I would not want to ignore them. Disabled rule should be on line (before line) where i want disable, not on all file.
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.
@evilebottnawi You can also leave them it's not a critical issue by any means, but I would still argue that while you are right for things like eval
no-eval
should occur where the code is, styling related stuff should be at the top (if needed) to lessen the noise while reading the code. These comments shouldn't be necessary at all normally... :)
@@ -39,15 +41,13 @@ class CompressionPlugin { | |||
|
|||
apply(compiler) { | |||
compiler.plugin('emit', (compilation, callback) => { | |||
const assets = compilation.assets; | |||
const { assets } = compilation; | |||
// eslint-disable-next-line consistent-return |
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.
See previous comment :)
src/index.js
Outdated
@@ -82,7 +82,7 @@ class CompressionPlugin { | |||
if (this.deleteOriginalAssets) { | |||
delete assets[file]; | |||
} | |||
cb(); | |||
return cb(); |
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.
cb();
return null;
?
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.
exclude
and include
optionsinclude
and exclude
options (options.include|options.exclude
)
acff2b7
to
6269e9d
Compare
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.
If nobody objects within the next 48 hours I will merge this PR or someone else merges it in the meantime :)
src/index.js
Outdated
@@ -14,6 +15,7 @@ class CompressionPlugin { | |||
this.compressionOptions = {}; | |||
|
|||
if (typeof this.algorithm === 'string') { | |||
// eslint-disable-next-line global-require |
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.
@evilebottnawi You can also leave them it's not a critical issue by any means, but I would still argue that while you are right for things like eval
no-eval
should occur where the code is, styling related stuff should be at the top (if needed) to lessen the noise while reading the code. These comments shouldn't be necessary at all normally... :)
src/index.js
Outdated
@@ -83,6 +83,7 @@ class CompressionPlugin { | |||
delete assets[file]; | |||
} | |||
cb(); |
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.
\ncb()\n
6269e9d
to
f9feda1
Compare
@michael-ciniawsky also add newlines before/after |
Notable Changes
Add an
include
&&exclude
option forassets
Issues
options.exclude
) #81Also fix
eslint
problems and fix typo('`') in documentation