-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.dev.config.js
More file actions
44 lines (43 loc) · 1.18 KB
/
webpack.dev.config.js
File metadata and controls
44 lines (43 loc) · 1.18 KB
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
var webpack = require('webpack');
var path = require('path');
require('dotenv').config();
module.exports = {
entry: [
"webpack-dev-server/client?http://localhost:5000",
"webpack/hot/only-dev-server",
'whatwg-fetch',
"./src/js/entry.js"
],
output: {
path: __dirname,
filename: "./build.js",
publicPath: "http://localhost:5000/"
},
resolve: {
extensions: ['.js'],
alias: {
'react': 'preact-compat',
'react-dom': 'preact-compat',
'react-addons-css-transition-group': 'rc-css-transition-group'
},
},
target: "web",
module: {
loaders: [
{
test: /\.js$/,
exclude: /(node_modules|bower_components)/,
loaders: ['babel-loader']
},
]
},
devtool: 'source-map',
plugins: [
new webpack.DefinePlugin({
SERVER_ADDRESS: JSON.stringify(process.env.REMOTE_SERVER ? process.env.REMOTE_DEV_SERVER_ADDRESS : process.env.LOCAL_DEV_SERVER_ADDRESS),
}),
new webpack.optimize.OccurrenceOrderPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.HotModuleReplacementPlugin(),
]
};