-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathwebpack.config-dev.js
55 lines (55 loc) · 1.36 KB
/
webpack.config-dev.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
var path = require("path");
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin'); //css单独打包
var HtmlWebpackPlugin = require('html-webpack-plugin');
var openBrowserWebpackPlugin = require('open-browser-webpack-plugin');
module.exports = {
devServer:{
port:8800,
contentBase:'./build',
hot: true,
inline: true,
progress: true,
historyApiFallback: true,
host: "0.0.0.0"
},
entry: ["babel-polyfill", path.resolve(__dirname, "app/app.js")],
output: {
path: path.resolve(__dirname, "build"),
filename: "bundle.js",
},
devtool: 'eval-source-map',
module: {
loaders: [
{
test: /\.js?$/,
exclude: /node_modules/,
loader: "babel-loader",
query: {
presets: ["es2015", "react", "stage-3"]
}
},
{
test: /\.css$/,
loader: 'style-loader!css-loader'
}
],
},
resolve: {
extensions: ['', '.js', '.jsx'],
// 提高webpack搜索的速度
alias: { }
},
devtool: 'source-map',
'display-error-details': true,
// 使用externals可以将react分离,然后用<script>单独将react引入
externals: [],
plugins:[
new webpack.HotModuleReplacementPlugin(),
new HtmlWebpackPlugin({
title:'react动态简历',
template:'./index.html',
filename:'index.html'
}),
],
}