-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
46 lines (45 loc) · 1.1 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
43
44
45
46
var webpack = require('webpack');
var path = require('path');
require('dotenv').config();
module.exports = {
entry: [
'whatwg-fetch',
"./src/js/entry.js"
],
target: "web",
output: {
path: __dirname,
filename: "./build-temp/build.js",
},
resolve: {
extensions: ['.js'],
alias: {
'react': 'preact-compat',
'react-dom': 'preact-compat',
'react-addons-css-transition-group': 'rc-css-transition-group'
},
},
module: {
loaders: [
{
test: /\.js$/,
include: [
path.resolve('src/js'),
path.resolve('node_modules/preact-compat/src')
],
loaders: ['babel-loader']
},
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
minimize: true,
compress: {warnings: false},
output: {comments: false},
sourceMap: true
}),
new webpack.DefinePlugin({
SERVER_ADDRESS: JSON.stringify(process.env.REMOTE_SERVER ? process.env.REMOTE_DEV_SERVER_ADDRESS : '')
}),
]
};