forked from JetBrains/ring-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack-test.config.js
40 lines (28 loc) · 974 Bytes
/
webpack-test.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
const path = require('path');
const webpack = require('webpack');
const {config, componentsPath} = require('./webpack.config');
const loaders = require('./webpack.config').loaders;
componentsPath.push(path.join(__dirname, 'src'));
const helpersPath = path.join(__dirname, 'test-helpers');
loaders.babelLoader.include.push(helpersPath);
loaders.babelLoader.sideEffects = true;
config.mode = 'development';
config.output = {
devtoolModuleFilenameTemplate: '/[absolute-resource-path]' // For some reason slash in the beginning is required
};
config.devtool = 'source-map';
config.plugins = [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"'
}
})
];
// this addresses internal `require`s in enzyme used for environment detection
config.externals = {
'react/addons': 'react',
'react/lib/ExecutionEnvironment': 'react',
'react/lib/ReactContext': 'react',
'react-addons-test-utils': 'window'
};
module.exports = config;