diff --git a/resolvers/webpack/CHANGELOG.md b/resolvers/webpack/CHANGELOG.md index f2d60ad03..814beb95d 100644 --- a/resolvers/webpack/CHANGELOG.md +++ b/resolvers/webpack/CHANGELOG.md @@ -6,6 +6,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel ## Unreleased ### Added - Support for explicit Webpack config object in `.eslintrc.*`. ([#572], thanks [@jameslnewell]) +- Added `resolve.modules` to configs for webpack2 support ([#569], thanks [@toshafed]) ## 0.6.0 - 2016-09-13 ### Added @@ -65,6 +66,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel Thanks to [@gausie] for the initial PR ([#164], ages ago! 😅) and [@jquense] for tests ([#278]). [#572]: https://github.com/benmosher/eslint-plugin-import/pull/572 +[#569]: https://github.com/benmosher/eslint-plugin-import/pull/569 [#533]: https://github.com/benmosher/eslint-plugin-import/pull/533 [#413]: https://github.com/benmosher/eslint-plugin-import/pull/413 [#377]: https://github.com/benmosher/eslint-plugin-import/pull/377 @@ -92,3 +94,4 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel [@Kovensky]: https://github.com/Kovensky [@grahamb]: https://github.com/grahamb [@jameslnewell]: https://github.com/jameslnewell +[@toshafed]: https://github.com/toshafed diff --git a/resolvers/webpack/index.js b/resolvers/webpack/index.js index 320b3955f..508323129 100644 --- a/resolvers/webpack/index.js +++ b/resolvers/webpack/index.js @@ -197,13 +197,15 @@ 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'), new ModuleAsDirectoryPlugin('module'), new DirectoryDescriptionFilePlugin( - 'package.json', ['module', 'jsnext:main'].concat(resolveConfig.packageMains || webpack1DefaultMains) + 'package.json', + ['module', 'jsnext:main'].concat(resolveConfig.packageMains || webpack1DefaultMains) ), new DirectoryDefaultFilePlugin(['index']), new FileAppendPlugin(resolveConfig.extensions || ['', '.webpack.js', '.web.js', '.js']), 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 6dcbbf4e3..7c7c8b3c8 100644 --- a/resolvers/webpack/test/files/webpack.config.js +++ b/resolvers/webpack/test/files/webpack.config.js @@ -5,8 +5,14 @@ module.exports = { resolve: { alias: { 'foo': path.join(__dirname, 'some', 'goofy', 'path', 'foo.js'), - 'some-alias': path.join(__dirname, 'some') + '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'),