Skip to content

Commit

Permalink
Merge branch 'resolve-config' (import-js#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmosher committed Oct 13, 2016
2 parents 001b8de + f7f768b commit d9605a0
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 3 deletions.
3 changes: 3 additions & 0 deletions resolvers/webpack/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 4 additions & 2 deletions resolvers/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
},
Expand Down
6 changes: 6 additions & 0 deletions resolvers/webpack/test/files/webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
8 changes: 7 additions & 1 deletion resolvers/webpack/test/files/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
5 changes: 5 additions & 0 deletions resolvers/webpack/test/files/webpack.config.multiple.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
},
Expand Down
6 changes: 6 additions & 0 deletions resolvers/webpack/test/files/webpack.function.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit d9605a0

Please sign in to comment.