Webpack test.js uses resolve.root too

I realised I should make the change in the test config as well. 

And it seems to better if the test config inherits from baseConfig and defaultSettings where possible, so I did that. That way you are testing as close to your actual config as possible. Especially because there is one test of the config path.
This commit is contained in:
M Clark
2016-04-06 11:43:47 +08:00
parent a6d65df3df
commit 3a5fa7c80f
+6 -11
View File
@@ -1,8 +1,7 @@
'use strict'; 'use strict';
let path = require('path'); let path = require('path');
let srcPath = path.join(__dirname, '/../src/'); let defaultSettings = require('./defaults');
let baseConfig = require('./base'); let baseConfig = require('./base');
// Add needed plugins here // Add needed plugins here
@@ -40,15 +39,11 @@ module.exports = {
}, },
resolve: { resolve: {
extensions: [ '', '.js', '.jsx' ], extensions: [ '', '.js', '.jsx' ],
alias: { root: [].concat(
actions: srcPath + 'actions/', baseConfig.resolve.root,
helpers: path.join(__dirname, '/../test/helpers'), [`${defaultSettings.srcPath}/test`]
components: srcPath + 'components/', ),
sources: srcPath + 'sources/', alias: baseConfig.resolve.alias
stores: srcPath + 'stores/',
styles: srcPath + 'styles/',
config: srcPath + 'config/' + process.env.REACT_WEBPACK_ENV
}
}, },
plugins: [ plugins: [
new BowerWebpackPlugin({ new BowerWebpackPlugin({