-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.dev.js
42 lines (39 loc) · 1.75 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
// const path = require('path');
// const merge = require('webpack-merge');
// const baseWebpackConfig = require('./webpack.config.base');
// const CleanWebpackPlugin = require('clean-webpack-plugin');
// const HtmlWebpackPlugin = require('html-webpack-plugin');
// const port = 8889;
// module.exports = merge(baseWebpackConfig, {
// entry: {
// app: path.join(__dirname, './test/index.js')
// },
// mode: 'development',
// devtool: "source-map",
// devServer: {
// contentBase: path.resolve(__dirname, 'dist'),//开发服务运行时的文件根目录
// historyApiFallback: true,//spa不跳转,history模式的路由需要true
// host: 'localhost',
// port: port,
// // hot:true,
// inline: true,//实时刷新
// compress: true,//Enable gzip compression for everything served
// overlay: true, //Shows a full-screen overlay in the browser
// stats: "errors-only",//To show only errors in your bundle
// open: true, //When open is enabled, the dev server will open the browser.
// },
// plugins: [
// new CleanWebpackPlugin(['dist']),
// new HtmlWebpackPlugin({//预览时使用
// template: path.resolve(__dirname, 'test', 'index.html'),//模板
// filename: 'index.html',
// inject: false, //允许插件修改哪些内容,包括head与body
// hash: true, //是否添加hash值
// minify: { //压缩HTML文件
// removeComments: true,//移除HTML中的注释
// collapseWhitespace: true //删除空白符与换行符
// },
// chunksSortMode: 'none' //如果使用webpack4将该配置项设置为'none'
// })
// ],
// });