Skip to content
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

fix compatibility issue with webpack 4 #62

Merged
merged 2 commits into from
Mar 4, 2018
Merged

fix compatibility issue with webpack 4 #62

merged 2 commits into from
Mar 4, 2018

Conversation

S0yKaf
Copy link
Contributor

@S0yKaf S0yKaf commented Feb 28, 2018

this.option.context has been deprecated since webpack 3, it's been
replaced by this.rootContext in webpack 4.

I haven't tested everything, this is just a really quick fix I did to make my webpack 4 compile.
I also don't know if this fix is backwards compatible.

however, this was the only instance of this.options.context in the code, so I doubt it will break anything.

See #61

`this.option.context` has been deprecated since webpack 3, it's been
replaced by `this.rootContext` in webpack 4.
@brenfrow
Copy link

brenfrow commented Mar 1, 2018

Please look into merging this :)

@bonesoul
Copy link

bonesoul commented Mar 2, 2018

also interested on this.

index.js Outdated
@@ -73,7 +73,7 @@ module.exports = function (source) {
hasRun = true;
}

var name = slash(path.relative(root || this.options.context, this.resourcePath));
var name = slash(path.relative(root || this.rootContext, this.resourcePath));
Copy link
Owner

Choose a reason for hiding this comment

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

Thanks, can keep this.options.context for backwards compatability please.

slash(path.relative(root || this.rootContext || this.options.context, this.resourcePath));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 smart

@S0yKaf
Copy link
Contributor Author

S0yKaf commented Mar 2, 2018

@at0g done!

@bonesoul
Copy link

bonesoul commented Mar 4, 2018

merge this maybe?

@at0g at0g merged commit 31f5c5b into at0g:master Mar 4, 2018
@bonesoul
Copy link

bonesoul commented Mar 5, 2018

@at0g can we also get a npm release please?

@bonesoul bonesoul mentioned this pull request Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants