-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
71 lines (69 loc) · 1.52 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
"use strict";
var webpack = require('webpack');
var path = require('path');
var loaders = require('./webpack.loaders');
var CopyWebpackPlugin = require('copy-webpack-plugin');
const HOST = process.env.HOST || "0.0.0.0";
const PORT = process.env.PORT || "8888";
const autoprefixer = require('autoprefixer');
const precss = require('precss');
const postcss = require('postcss');
const postcssImport = require('postcss-import');
module.exports = {
entry: [
`webpack-dev-server/client?http://${HOST}:${PORT}`, // WebpackDevServer host and port
`webpack/hot/only-dev-server`,
`./src/index.jsx` // Your appʼs entry point
],
devtool: process.env.WEBPACK_DEVTOOL || 'source-map',
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
'sinon': 'sinon/pkg/sinon'
}
},
// preLoaders:
// {
// test: /\.json$/,
// loaders: ['json-loader']
// },
module: {
loaders
},
noParse: [
/node_modules\/sinon\//,
],
devServer: {
contentBase: "./public",
noInfo: true, // --no-info option
hot: true,
inline: true,
port: PORT,
host: HOST
},
plugins: [
new webpack.NoErrorsPlugin(),
new webpack.HotModuleReplacementPlugin(),
new CopyWebpackPlugin([
{from: './src/index.html'}
]),
],
postcss() {
return [
postcssImport({
addDependencyTo: webpack
}),
precss,
autoprefixer
];
},
externals: {
'react/addons': true, // important!!
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true
}
};