forked from Alex-xd/seeMusic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.dev.conf.js
38 lines (34 loc) · 1.11 KB
/
webpack.dev.conf.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
const webpack = require('webpack');
const config = require('./webpack.base.conf');
const HtmlWebpackPlugin = require('html-webpack-plugin');
config.output.publicPath = '/'
config.devtool = '#cheap-module-eval-source-map';
config.plugins = (config.plugins || []).concat([
new HtmlWebpackPlugin({
title: 'See Music',
// 在devServer中这里的filename是相对于output.publicPath的路径!
// 所以使用了此插件其实就不管output.path的路径了,因为在index.html
// 中引用的文件路径都被publicPath替换了,所以就相当于所有文件都在
// http://localhost:8000/ 下面
filename: 'index.html',
template: 'src/index.template.html',
favicon:'src/assets/favicon.png',
hash: false,
minify: {
removeComments: true
}
}),
]);
config.devServer = {
historyApiFallback: true,
noInfo: true,
port: 8000,
proxy: {
'/Server/**': {
changeOrigin: true,
target: 'https://music.alexxd.com/',
secure: false
}
}
};
module.exports = config