-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.tests.js
53 lines (50 loc) · 1.2 KB
/
webpack.tests.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const path = require('path');
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common');
module.exports = merge(common, {
externals: {
cheerio: 'window',
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
},
devtool: 'inline-source-map',
module: {
preLoaders: [],
loaders: [
{
test: /\.js$/,
include: [
path.resolve(__dirname, '../app'),
path.resolve(__dirname, './'),
],
loader: 'babel',
query: {
plugins: [
['istanbul', {
exclude: [
'**/*.spec.js',
'**/specs.bootstrap.js',
],
}],
],
presets: ['es2015', 'node6', 'react', 'stage-2'],
},
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
},
],
},
plugins: [
new webpack.DefinePlugin({
SETTINGS: {
API_URL: JSON.stringify('https://mock-api.fi/'),
REPORT_URL: JSON.stringify('https://mock-reports.fi/'),
},
}),
new webpack.IgnorePlugin(/ReactContext/),
],
});