-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
42 lines (41 loc) · 1.23 KB
/
webpack.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
40
41
42
var debug = process.env.NODE_ENV !== "production";
var path = require('path');
var webpack = require('webpack');
module.exports = {
devtool: debug ? "inline-sourcemap" : false,
entry: "./source/ThermalVisualizer.js",
module: {
rules: [
{
test: /\.js?$/,
exclude: [
path.resolve(__dirname, "node_modules"),
path.resolve(__dirname, "bower_components")
],
loader: 'babel-loader',
options: {
presets: ['react', 'env', 'stage-0'],
plugins: ['react-html-attrs', 'transform-class-properties', 'transform-decorators-legacy']
}
}
]
},
output: {
path: path.resolve(__dirname, 'visualizer/js/'),
publicPath: "js/",
filename: "thermal-visualizer.min.js"
},
plugins: debug ? [] : [
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin()
],
devServer: {
contentBase: path.resolve(__dirname, 'visualizer'),
compress: true,
port: 8081
}
};