mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-06-27 17:16:57 +08:00
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:
+6
-11
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user