This commit is contained in:
2025-10-01 00:29:21 +08:00
parent 5737973197
commit b3ab17660a
4 changed files with 108 additions and 101 deletions

View File

@@ -1,6 +1,7 @@
const { VueLoaderPlugin } = require('vue-loader');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const webpack = require('webpack'); // 引入 webpack 模块
module.exports = (env, argv) => {
const isDevelopment = argv.mode === 'development';
@@ -38,6 +39,12 @@ module.exports = (env, argv) => {
new HtmlWebpackPlugin({
template: './index.html',
filename: 'index.html'
}),
// 添加 Vue 特性标志的定义
new webpack.DefinePlugin({
__VUE_OPTIONS_API__: JSON.stringify(true),
__VUE_PROD_DEVTOOLS__: JSON.stringify(isDevelopment),
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: JSON.stringify(isDevelopment)
})
],
devServer: {