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';
let path = require('path');
let srcPath = path.join(__dirname, '/../src/');
let defaultSettings = require('./defaults');
let baseConfig = require('./base');
// Add needed plugins here
@@ -40,15 +39,11 @@ module.exports = {
},
resolve: {
extensions: [ '', '.js', '.jsx' ],
alias: {
actions: srcPath + 'actions/',
helpers: path.join(__dirname, '/../test/helpers'),
components: srcPath + 'components/',
sources: srcPath + 'sources/',
stores: srcPath + 'stores/',
styles: srcPath + 'styles/',
config: srcPath + 'config/' + process.env.REACT_WEBPACK_ENV
}
root: [].concat(
baseConfig.resolve.root,
[`${defaultSettings.srcPath}/test`]
),
alias: baseConfig.resolve.alias
},
plugins: [
new BowerWebpackPlugin({