mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-06-27 18:25:20 +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';
|
'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({
|
||||||
|
|||||||
Reference in New Issue
Block a user