2019-01-12 11:33:27 +08:00
|
|
|
const path = require('path');
|
|
|
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
|
|
const merge = require('webpack-merge');
|
2019-12-30 17:11:03 +08:00
|
|
|
const baseWebpackConfig = require('./webpack.base.conf');
|
2017-10-26 15:18:08 +08:00
|
|
|
|
2018-01-23 18:55:39 +08:00
|
|
|
module.exports = merge(baseWebpackConfig, {
|
2019-01-20 21:13:55 +08:00
|
|
|
mode: 'development',
|
2017-10-26 15:18:08 +08:00
|
|
|
output: {
|
2019-12-30 17:11:03 +08:00
|
|
|
path: path.resolve(__dirname, '../dist'),
|
2019-02-16 16:51:21 +08:00
|
|
|
publicPath: '/',
|
2017-10-26 15:18:08 +08:00
|
|
|
filename: 'build.js',
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.less$/,
|
|
|
|
use: [
|
2019-01-27 11:43:55 +08:00
|
|
|
{ loader: 'vue-style-loader' },
|
2017-10-26 15:18:08 +08:00
|
|
|
{
|
|
|
|
loader: 'css-loader',
|
|
|
|
options: { sourceMap: true },
|
|
|
|
},
|
2019-01-20 21:13:55 +08:00
|
|
|
{ loader: 'less-loader', options: { sourceMap: true, javascriptEnabled: true } },
|
2017-10-26 15:18:08 +08:00
|
|
|
],
|
|
|
|
},
|
2018-01-23 18:55:39 +08:00
|
|
|
{
|
|
|
|
test: /\.css$/,
|
2019-01-27 11:43:55 +08:00
|
|
|
use: ['vue-style-loader', 'css-loader'],
|
2018-01-23 18:55:39 +08:00
|
|
|
},
|
2017-10-26 15:18:08 +08:00
|
|
|
],
|
|
|
|
},
|
|
|
|
devServer: {
|
|
|
|
port: 3000,
|
2018-02-04 15:02:57 +08:00
|
|
|
host: '0.0.0.0',
|
2017-10-26 15:18:08 +08:00
|
|
|
historyApiFallback: {
|
2019-02-16 16:51:21 +08:00
|
|
|
rewrites: [{ from: /./, to: '/index.html' }],
|
2017-10-26 15:18:08 +08:00
|
|
|
},
|
|
|
|
disableHostCheck: true,
|
2019-12-30 17:11:03 +08:00
|
|
|
hot: true,
|
|
|
|
open: true,
|
2017-10-26 15:18:08 +08:00
|
|
|
headers: { 'Access-Control-Allow-Origin': '*' },
|
|
|
|
},
|
|
|
|
performance: {
|
|
|
|
hints: false,
|
|
|
|
},
|
2018-01-08 18:31:04 +08:00
|
|
|
devtool: '#source-map',
|
2018-01-23 18:55:39 +08:00
|
|
|
plugins: [
|
|
|
|
new HtmlWebpackPlugin({
|
2018-04-04 18:39:21 +08:00
|
|
|
template: 'site/index.html',
|
2018-01-23 18:55:39 +08:00
|
|
|
filename: 'index.html',
|
|
|
|
inject: true,
|
|
|
|
}),
|
|
|
|
],
|
2019-01-12 11:33:27 +08:00
|
|
|
});
|