-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
42 lines (42 loc) · 1.11 KB
/
webpack.config.js
File metadata and controls
42 lines (42 loc) · 1.11 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
var webpack = require('webpack');
// var HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
entry: __dirname + "/app/index.js",//入口文件
output: {
path: __dirname + "/public",//打包后的文件存放的地方
filename: "bundle.js"//打包后输出文件的文件名
},
module: {
rules: [
{
test: /\.txt$/,
use: 'raw-loader'
}
]
},
plugins: [
// new HtmlWebpackPlugin({
// template: __dirname + "/app/index.tmpl.html"
// }),
new webpack.HotModuleReplacementPlugin()//热加载插件
],
devServer: {
// colors: true,
// historyApiFallback: {
// rewrites:[
// {from:/./,to:'/index.html'}
// ]
// },
// contentBase: "./",//本地服务器所加载的页面所在的目录
// colors: true,//终端中输出结果为彩色
historyApiFallback: true,//不跳转
inline: true,//实时刷新
hot: true,
// compress: true,
port:8081,
publicPath: "/"
// proxy:{
// "/index":"http://localhost:8081/decodeMorse.html"
// }
}
}