mirror of
https://github.com/wassname/react-webpack-template.git
synced 2026-06-27 18:25:20 +08:00
3a5fa7c80f
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.
54 lines
1.1 KiB
JavaScript
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
|
|
})
|
|
]
|
|
};
|