Skip to content

Commit

Permalink
add resolve configs for webpack2 (since 2.1.0-beta.23)
Browse files Browse the repository at this point in the history
  • Loading branch information
toshafed committed Sep 21, 2016
1 parent ee02fef commit f7f768b
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 1 deletion.
3 changes: 2 additions & 1 deletion resolvers/webpack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
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
6 changes: 6 additions & 0 deletions resolvers/webpack/test/files/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
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 f7f768b

Please sign in to comment.