-
Notifications
You must be signed in to change notification settings - Fork 9
fix(index): use emit
hook instead of this-compilation
#8
Conversation
the build is failing unrelated to the changes (nsp warning) |
emit
hook instead of this-compilation
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.
@eseliger Thx
} | ||
} else if (this.test && !this.test.test(file)) { | ||
compiler.plugin('emit', (compilation, callback) => { | ||
const { assets } = compilation; |
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.
\n
let content = asset.source(); | ||
} else if (this.test && !this.test.test(file)) { | ||
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.
\n
src/index.js
Outdated
this.algorithm(content, this.compressionOptions, (err, result) => { | ||
if (err) { return cb(err); } | ||
this.algorithm(content, this.compressionOptions, (err, result) => { | ||
if (err) { return cb(err); } |
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 don't 'inline' functions body's, whitespace is cheap :)
- if (err) { return cb(err); }
+ if (err) {
+ return cb(err);
+ }
src/index.js
Outdated
|
||
let newFile = this.asset.replace(/\[(file|path|query)\]/g, (p0, p1) => sub[p1]); | ||
let newFile = this.asset.replace(/\[(file|path|query)\]/g, (p0, p1) => sub[p1]); |
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.
newFile
=> newAsset
src/index.js
Outdated
assets[newFile] = new RawSource(result); | ||
if (typeof this.filename === 'function') { | ||
newFile = this.filename(newFile); | ||
} |
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.
\n
src/index.js
Outdated
|
||
let newFile = this.asset.replace(/\[(file|path|query)\]/g, (p0, p1) => sub[p1]); | ||
let newFile = this.asset.replace(/\[(file|path|query)\]/g, (p0, p1) => sub[p1]); |
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.
\n
@michael-ciniawsky I can change the style, if you want, but I didn't change it, i just indented these rows, thats why they are in the diff. It was like that before. |
Updating them would be appreciated :) |
Codecov Report
@@ Coverage Diff @@
## master #8 +/- ##
===================================
Coverage 0% 0%
===================================
Files 2 2
Lines 51 51
Branches 26 26
===================================
Misses 33 33
Partials 18 18
Continue to review full report at Codecov.
|
@michael-ciniawsky updated the style, let me know if I missed something! :) |
is there anything I can do to bring this forward? :) |
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.
@eseliger Thx
All the time! Let me know when you'll release it on npm |
Unfortunately I realised that I don't have |
Okay, awesome! |
@michael-ciniawsky Any news? |
@michael-ciniawsky @eseliger Any update? This is a great improvement that we are waiting for. |
Issues
Notable Changes
Made the change, as discussed in #7