var path = require('path') var webpack = require('webpack') const WebpackMerge = require('webpack-merge') const baseConfig = require('./webpack.base.js') let HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = WebpackMerge.merge(baseConfig, { mode: 'development', entry: path.join(__dirname, 'examples/main.js'), // 入口文件 output: { path: path.join(__dirname, 'dist'), // 打包后文件存放的地方 filename: 'dist/build.js' // 打包后输出的文件名 }, devServer: { port: 8086, historyApiFallback: true, }, plugins: (module.exports.plugins || []).concat([ new webpack.DefinePlugin({ __VUE_OPTIONS_API__: false, __VUE_PROD_DEVTOOLS__: false, }), new HtmlWebpackPlugin({ // html-webpack-plugin 插件对象 template: path.join(__dirname, './index.html'), // 指定模板文件 filename: 'index.html' // 设置内存中的文件名 }) ]) })