-
Notifications
You must be signed in to change notification settings - Fork 14
/
webpack.config-test.js
40 lines (39 loc) · 1.12 KB
/
webpack.config-test.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
var path = require('path');
var webpack = require("webpack");
var nodeExternals = require('webpack-node-externals');
const TARGET = process.env.npm_lifecycle_event;
module.exports = {
devtool: "cheap-module-source-map",
externals: [
nodeExternals(), // in order to ignore all modules in node_modules folder.
{
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
}
],
mode: 'production',
module: {
rules: [
{
test: /\.js$/,
use: ["babel-loader"]
},
{
test: /\.jsx$/,
use: ["babel-loader?cacheDirectory"]
}
]
},
output: {
// sourcemap support for IntelliJ/Webstorm
devtoolModuleFilenameTemplate: '[absolute-resource-path]',
devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]'
},
resolve: {
alias: {
'app': path.join(__dirname, '/src/index.js')
}
},
target: 'node'
};