Files
react-webpack-template/cfg/test.js
T
M Clark 3a5fa7c80f 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.
2016-04-06 11:43:47 +08:00

54 lines
1.1 KiB
JavaScript

'use strict';
let path = require('path');
let defaultSettings = require('./defaults');
let baseConfig = require('./base');
// Add needed plugins here
let BowerWebpackPlugin = require('bower-webpack-plugin');
module.exports = {
devtool: 'eval',
module: {
preLoaders: [
{
test: /\.(js|jsx)$/,
loader: 'isparta-instrumenter-loader',
include: [
path.join(__dirname, '/../src')
]
}
],
loaders: [
{
test: /\.(png|jpg|gif|woff|woff2|css|sass|scss|less|styl)$/,
loader: 'null-loader'
},
{
test: /\.(js|jsx)$/,
loader: 'babel-loader',
include: [].concat(
baseConfig.additionalPaths,
[
path.join(__dirname, '/../src'),
path.join(__dirname, '/../test')
]
)
}
]
},
resolve: {
extensions: [ '', '.js', '.jsx' ],
root: [].concat(
baseConfig.resolve.root,
[`${defaultSettings.srcPath}/test`]
),
alias: baseConfig.resolve.alias
},
plugins: [
new BowerWebpackPlugin({
searchResolveModulesDirectories: false
})
]
};