diff --git a/resolvers/webpack/index.js b/resolvers/webpack/index.js index efe35f151..4f32fae18 100644 --- a/resolvers/webpack/index.js +++ b/resolvers/webpack/index.js @@ -185,7 +185,8 @@ function createWebpack1ResolveSync(webpackRequire, resolveConfig, plugins) { new ModuleAliasPlugin(resolveConfig.alias || {}), makeRootPlugin(ModulesInRootPlugin, 'module', resolveConfig.root), new ModulesInDirectoriesPlugin( - 'module', resolveConfig.modulesDirectories || ['web_modules', 'node_modules'] + 'module', + resolveConfig.modulesDirectories || resolveConfig.modules || ['web_modules', 'node_modules'] ), makeRootPlugin(ModulesInRootPlugin, 'module', resolveConfig.fallback), new ModuleAsFilePlugin('module'), diff --git a/resolvers/webpack/test/config-extensions/webpack.config.babel.js b/resolvers/webpack/test/config-extensions/webpack.config.babel.js index dfe585a67..41dc6c8e8 100644 --- a/resolvers/webpack/test/config-extensions/webpack.config.babel.js +++ b/resolvers/webpack/test/config-extensions/webpack.config.babel.js @@ -5,6 +5,12 @@ export default { alias: { 'foo': path.join(__dirname, 'some', 'goofy', 'path', 'foo.js'), }, + modules: [ + path.join(__dirname, 'src'), + path.join(__dirname, 'fallback'), + 'node_modules', + 'bower_components', + ], modulesDirectories: ['node_modules', 'bower_components'], root: path.join(__dirname, 'src'), fallback: path.join(__dirname, 'fallback'), diff --git a/resolvers/webpack/test/files/some/absolute.path.webpack.config.js b/resolvers/webpack/test/files/some/absolute.path.webpack.config.js index 4748d186d..a7cf17d6e 100644 --- a/resolvers/webpack/test/files/some/absolute.path.webpack.config.js +++ b/resolvers/webpack/test/files/some/absolute.path.webpack.config.js @@ -5,6 +5,11 @@ module.exports = { alias: { 'foo': path.join(__dirname, 'absolutely', 'goofy', 'path', 'foo.js'), }, + modules: [ + path.join(__dirname, 'src'), + 'node_modules', + 'bower_components', + ], modulesDirectories: ['node_modules', 'bower_components'], root: path.join(__dirname, 'src'), }, diff --git a/resolvers/webpack/test/files/webpack.config.babel.js b/resolvers/webpack/test/files/webpack.config.babel.js index dfe585a67..41dc6c8e8 100644 --- a/resolvers/webpack/test/files/webpack.config.babel.js +++ b/resolvers/webpack/test/files/webpack.config.babel.js @@ -5,6 +5,12 @@ export default { alias: { 'foo': path.join(__dirname, 'some', 'goofy', 'path', 'foo.js'), }, + modules: [ + path.join(__dirname, 'src'), + path.join(__dirname, 'fallback'), + 'node_modules', + 'bower_components', + ], modulesDirectories: ['node_modules', 'bower_components'], root: path.join(__dirname, 'src'), fallback: path.join(__dirname, 'fallback'), diff --git a/resolvers/webpack/test/files/webpack.config.js b/resolvers/webpack/test/files/webpack.config.js index 93512d306..7c7c8b3c8 100644 --- a/resolvers/webpack/test/files/webpack.config.js +++ b/resolvers/webpack/test/files/webpack.config.js @@ -7,6 +7,12 @@ module.exports = { 'foo': path.join(__dirname, 'some', 'goofy', 'path', 'foo.js'), 'some-alias': path.join(__dirname, 'some'), }, + modules: [ + path.join(__dirname, 'src'), + path.join(__dirname, 'fallback'), + 'node_modules', + 'bower_components', + ], modulesDirectories: ['node_modules', 'bower_components'], root: path.join(__dirname, 'src'), fallback: path.join(__dirname, 'fallback'), diff --git a/resolvers/webpack/test/files/webpack.config.multiple.js b/resolvers/webpack/test/files/webpack.config.multiple.js index f2ab9185a..b79c4c08a 100644 --- a/resolvers/webpack/test/files/webpack.config.multiple.js +++ b/resolvers/webpack/test/files/webpack.config.multiple.js @@ -14,6 +14,11 @@ module.exports = [{ alias: { 'foo': path.join(__dirname, 'some', 'goofy', 'path', 'foo.js'), }, + modules: [ + path.join(__dirname, 'src'), + 'node_modules', + 'bower_components', + ], modulesDirectories: ['node_modules', 'bower_components'], root: path.join(__dirname, 'src'), }, diff --git a/resolvers/webpack/test/files/webpack.function.config.js b/resolvers/webpack/test/files/webpack.function.config.js index ccc43610b..7f07afda6 100644 --- a/resolvers/webpack/test/files/webpack.function.config.js +++ b/resolvers/webpack/test/files/webpack.function.config.js @@ -8,6 +8,12 @@ module.exports = function() { 'foo': path.join(__dirname, 'some', 'goofy', 'path', 'foo.js'), 'some-alias': path.join(__dirname, 'some'), }, + modules: [ + path.join(__dirname, 'src'), + path.join(__dirname, 'fallback'), + 'node_modules', + 'bower_components', + ], modulesDirectories: ['node_modules', 'bower_components'], root: path.join(__dirname, 'src'), fallback: path.join(__dirname, 'fallback'),