-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Create explicit loader path #555
Conversation
It used to be |
Either |
The output is handled by webpack itself. The root of the problem is the webpack loader resolve logic - How would react-comos work with loaders? |
All loader paths are resolved, for webpack to load them from the inside of that particular package (i.e. |
What about this one? Webpack 1: resolveLoader: {
fallback: path.join(__dirname, '../node_modules'),
}, And for Webpack 2: resolveLoader: {
modules: [
'node_modules',
path.join(__dirname, '../node_modules'),
],
}, |
Should work, but I switched to using a fork that includes this PR to move forward. Not happy with it because it adds to the management cost, but feel free to close this if you're sure you don't want to return to resolving the loader path. |
I guess I will revert the change so it works again with plugins like yours again and move the change to html-webpack-html 3.x version which won't support webpack 1 anyway |
Fixed in 2.27.1 |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Problem
The
html-webpack-plugin/lib/loader.js
path assumeshtml-webpack-plugin
will be found where webpack runs, except in some rare cases it isn't so. In Lerna setups like that of react-cosmos, you can have one package havehtml-webpack-plugin
as a dep and another package havewebpack
as a dep. Because the way packages are linked in this setup they each have their own node_modules bucket and deps installed on one side aren't found in the other (until lib is actually published and user installs, then everything ends up normalized in the same node_modules dir).Solution
By pinning down the exact path this problem disappears. Can't think of any downside and all tests pass. Thoughts?
Thanks!