fixed webpack devserver to serve router subpath
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||
const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin');
|
||||
const { VueLoaderPlugin } = require('vue-loader')
|
||||
|
||||
const utils = require('./utils')
|
||||
@@ -67,8 +68,10 @@ module.exports = {
|
||||
new HtmlWebpackPlugin({
|
||||
filename: 'index.html',
|
||||
template: 'index.html',
|
||||
inject: true
|
||||
inject: true,
|
||||
alwaysWriteToDisk: true
|
||||
}),
|
||||
new HtmlWebpackHarddiskPlugin(),
|
||||
new VueLoaderPlugin(),
|
||||
new CopyWebpackPlugin([{
|
||||
from: utils.resolve('static/img'),
|
||||
|
||||
@@ -10,13 +10,21 @@ const PORT = 8988
|
||||
module.exports = merge(baseConfig, {
|
||||
mode: 'development',
|
||||
|
||||
output: {
|
||||
publicPath: '/'
|
||||
},
|
||||
|
||||
devServer: {
|
||||
clientLogLevel: 'warning',
|
||||
clientLogLevel: 'debug',
|
||||
historyApiFallback: {
|
||||
rewrites: [
|
||||
{ from: /.*/, to: '/index.html' },
|
||||
],
|
||||
// rewrites: [
|
||||
// { from: /.*/, to: '/index.html' },
|
||||
// ],
|
||||
index: '/',
|
||||
disableDotRule: true,
|
||||
verbose: true
|
||||
},
|
||||
// historyApiFallback: true,
|
||||
hot: true,
|
||||
contentBase: 'dist',
|
||||
compress: true,
|
||||
@@ -24,10 +32,10 @@ module.exports = merge(baseConfig, {
|
||||
host: '0.0.0.0',
|
||||
port: PORT,
|
||||
disableHostCheck: true,
|
||||
// open: "firefox-developer-edition",
|
||||
overlay: { warnings: false, errors: true },
|
||||
publicPath: '/',
|
||||
quiet: true,
|
||||
quiet: false,
|
||||
// open: "firefox-developer-edition",
|
||||
},
|
||||
|
||||
module: {
|
||||
|
||||
Reference in New Issue
Block a user