I have a project like this:
root/ webpack-config.js app/ app.js js/ dep.js core/ module.js
Here is the webpack configuration file:
module.exports = { entry: './app/app.js', output: { path: __dirname, filename: "[name]-bundle.js" }, module: { loaders: [ { test: /\.js$/, loader: 'babel-loader', exclude: /node_modules/ } ] }, resolve: { modulesDirectories: ['core'] } ...
in app.js, I have:
import local_dep from './js/dep'; import myModule from 'module';
This works, as expected, using webpack 1.x, but the myModule module is not resolved using webpack 2, I get "Module not found: it is not possible to resolve the" module "in ... \ application".
It seems that the modulesDirectories entry is being ignored and the base URL matches the input folder.
What can I do to get modules resolved correctly with webpack 2?
javascript webpack webpack-2
user3475757
source share