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
Not able to load custom node_modules directory via resolveLoader in Webpack 2 #3160
Comments
Hi, I am experiencing the same issue at current and was about to log an issue before finding this post, I thought it may potentially be of use for me to post my issue as a comment on here for interest sake. Is this considered a high priority issue, may I ask what the status of it is at current? Webpack version: Environment: Framework/Language: Current behavior: I have a submodule which is used across all my projects as a global base for my build config. This means that there are essentially 2 core "node_modules" directories, one being in the submodule which is used across all projects and the other being part of the project in question. As per the webpack documentation, I am using the resolve.modules to define the path to the base node_modules in the submodule, I am then also defining the path to the node_modules in the current project for the project specific third party libraries. On building the solution, only the modules in the current project's node_modules are resolve, the modules in the base(shared) submodule are not resolved. For clarity, please see the file structure and corresponding webpack config below: File Structure:
Webpack Config Expected/desired behavior: |
+1 |
I am having this same issue. Unfortunately my company's build system puts the node modules into a custom, deeply nested folder, and I don't have the power to change it to the standard Please advise when this problem will be fixed. |
I am having the same problem. webpack version Webpack Config resolve: { Error: "ReferenceError: Unknown plugin "transform-react-jsx" specified in "base" at 0, attempted to resolve relative to ..." "Couldn't find preset "latest" relative to directory ... " Please advise when this problem will be fixed. |
maybe what you're looking for is something like: module.exports = {
dependencies: [
path.join(__dirname, "..", "node_modules")
],
entry: './src/main.js',
output: {
...
}
...
} |
I am having the same issue as the people above in a typescript project. @nicolocodev just tried your suggestion and it didn't work with webpack 2.6.1 |
Closing due to inactivity. Please test with latest webpack version and feel free to reopen if still regressions. Thanks! |
I'm submitting a bug report
Webpack version: 2.1.0-beta.25
Language: TypeScript 2.0.3
Environment: Windows 7
Current behaviour:
If the node_modules directory is not in the same directory as source files, the build results in errors like:
Steps to reproduce:
src
directory is one directory up, like this example (simplified):It feels strange to me as I've tried all kinds of things with resolve.modules and resolveLoader.modules .etc but nothing works as expected. Am I simply going about this the wrong way or is this an issue with resolving in webpack 2?
I've put together a gist with my webpack.common.js here, resolveLoader starts on line 80.
The text was updated successfully, but these errors were encountered: