-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Webpack Resolver fix for case config is an array of functions (#1220)
* Added test for plugin-webpack-resolver: webpack config is an array of functions * plugin-webpack-resolver: handle case when webpack config is an array of functions * Updated Changelog * Updated call of webpack config function
- Loading branch information
Showing
4 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
resolvers/webpack/test/files/webpack.function.config.multiple.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
var path = require('path') | ||
var pluginsTest = require('webpack-resolver-plugin-test') | ||
|
||
module.exports = [function(env) { | ||
return { | ||
resolve: { | ||
alias: { | ||
'foo': path.join(__dirname, 'some', 'goofy', 'path', 'foo.js'), | ||
'bar': env ? path.join(__dirname, 'some', 'goofy', 'path', 'bar.js') : undefined, | ||
'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'), | ||
}, | ||
|
||
externals: [ | ||
{ 'jquery': 'jQuery' }, | ||
'bootstrap', | ||
function (context, request, callback) { | ||
if (request === 'underscore') { | ||
return callback(null, 'underscore') | ||
} | ||
callback() | ||
}, | ||
], | ||
|
||
plugins: [ | ||
new pluginsTest.ResolverPlugin([ | ||
new pluginsTest.SimpleResolver( | ||
path.join(__dirname, 'some', 'bar', 'bar.js'), | ||
path.join(__dirname, 'some', 'bar') | ||
), | ||
]), | ||
], | ||
} | ||
}] |