|
|
|
@ -1,10 +1,11 @@
|
|
|
|
|
'use strict'
|
|
|
|
|
const path = require('path')
|
|
|
|
|
const utils = require('./utils')
|
|
|
|
|
const webpack = require('webpack')
|
|
|
|
|
const config = require('../config')
|
|
|
|
|
const merge = require('webpack-merge')
|
|
|
|
|
const path = require('path')
|
|
|
|
|
const baseWebpackConfig = require('./webpack.base.conf')
|
|
|
|
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin')
|
|
|
|
|
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
|
|
|
|
|
const portfinder = require('portfinder')
|
|
|
|
@ -26,8 +27,13 @@ const devWebpackConfig = merge(baseWebpackConfig, {
|
|
|
|
|
// these devServer options should be customized in /config/index.js
|
|
|
|
|
devServer: {
|
|
|
|
|
clientLogLevel: 'warning',
|
|
|
|
|
historyApiFallback: true,
|
|
|
|
|
historyApiFallback: {
|
|
|
|
|
rewrites: [
|
|
|
|
|
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
hot: true,
|
|
|
|
|
contentBase: false, // since we use CopyWebpackPlugin.
|
|
|
|
|
compress: true,
|
|
|
|
|
host: HOST || config.dev.host,
|
|
|
|
|
port: PORT || config.dev.port,
|
|
|
|
@ -57,6 +63,14 @@ const devWebpackConfig = merge(baseWebpackConfig, {
|
|
|
|
|
favicon: resolve('favicon.ico'),
|
|
|
|
|
title: 'vue-element-admin'
|
|
|
|
|
}),
|
|
|
|
|
// copy custom static assets
|
|
|
|
|
new CopyWebpackPlugin([
|
|
|
|
|
{
|
|
|
|
|
from: path.resolve(__dirname, '../static'),
|
|
|
|
|
to: config.dev.assetsSubDirectory,
|
|
|
|
|
ignore: ['.*']
|
|
|
|
|
}
|
|
|
|
|
])
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|