diff --git a/cfg/base.js b/cfg/base.js index 94e7938..fd4ec26 100644 --- a/cfg/base.js +++ b/cfg/base.js @@ -29,12 +29,18 @@ module.exports = { }, resolve: { extensions: ['', '.js', '.jsx'], + root: [ + `${defaultSettings.srcPath}/actions`, + `${defaultSettings.srcPath}/components`, + `${defaultSettings.srcPath}/dispatchers`, + `${defaultSettings.srcPath}/sources`, + `${defaultSettings.srcPath}/stores`, + `${defaultSettings.srcPath}/styles`, + `${defaultSettings.srcPath}/helpers`, + `${defaultSettings.srcPath}/data`, + `${defaultSettings.srcPath}` + ], alias: { - actions: `${defaultSettings.srcPath}/actions/`, - components: `${defaultSettings.srcPath}/components/`, - sources: `${defaultSettings.srcPath}/sources/`, - stores: `${defaultSettings.srcPath}/stores/`, - styles: `${defaultSettings.srcPath}/styles/`, config: `${defaultSettings.srcPath}/config/` + process.env.REACT_WEBPACK_ENV } }, diff --git a/cfg/test.js b/cfg/test.js index f139c49..0bc5c54 100644 --- a/cfg/test.js +++ b/cfg/test.js @@ -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({