Skip to content
This repository has been archived by the owner on Sep 5, 2018. It is now read-only.

fix(index): use emit hook instead of this-compilation #8

Merged
merged 2 commits into from
Feb 25, 2018

Conversation

eseliger
Copy link
Contributor

@eseliger eseliger commented Feb 18, 2018

@jsf-clabot
Copy link

jsf-clabot commented Feb 18, 2018

CLA assistant check
All committers have signed the CLA.

@eseliger
Copy link
Contributor Author

the build is failing unrelated to the changes (nsp warning)

Copy link
Member

@michael-ciniawsky michael-ciniawsky left a 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;
Copy link
Member

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();
}
Copy link
Member

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); }
Copy link
Member

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]);
Copy link
Member

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);
}
Copy link
Member

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]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\n

@michael-ciniawsky michael-ciniawsky added this to the 0.1.1 milestone Feb 18, 2018
@eseliger
Copy link
Contributor Author

@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.
Let me know what you think

@michael-ciniawsky
Copy link
Member

Updating them would be appreciated :)

@codecov
Copy link

codecov bot commented Feb 22, 2018

Codecov Report

Merging #8 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@         Coverage Diff         @@
##           master   #8   +/-   ##
===================================
  Coverage       0%   0%           
===================================
  Files           2    2           
  Lines          51   51           
  Branches       26   26           
===================================
  Misses         33   33           
  Partials       18   18
Impacted Files Coverage Δ
src/index.js 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ced262b...a1caa02. Read the comment docs.

@eseliger
Copy link
Contributor Author

@michael-ciniawsky updated the style, let me know if I missed something! :)

@eseliger
Copy link
Contributor Author

is there anything I can do to bring this forward? :)

Copy link
Member

@michael-ciniawsky michael-ciniawsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eseliger Thx

@eseliger
Copy link
Contributor Author

All the time! Let me know when you'll release it on npm

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Feb 25, 2018

Unfortunately I realised that I don't have npm publish access to this repo (yet) atm. Which hopefully will be fixed within the next 1-2 days or someone else cuts a release (I pinged folks already :)). We will release it asap whenever possible

@eseliger
Copy link
Contributor Author

Okay, awesome!

@Kaesebrot84
Copy link

@michael-ciniawsky Any news?

@fabioscsilva
Copy link

@michael-ciniawsky @eseliger Any update? This is a great improvement that we are waiting for.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants