代码拉取完成,页面将自动刷新
/* eslint-disable */
const path = require("path");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = (env, argv) => ({
entry: {
index: "./src/index.ts",
},
devtool: argv.mode === "production" ? false : "eval-cheap-module-source-map",
output: {
path: path.resolve(__dirname, "./dist"),
filename: "[name].[chunkhash].js",
globalObject: "this",
},
module: {
rules: [
{
test: /\.css$/,
use: ["style-loader", "css-loader"],
},
{
test: /\.tsx?$/,
loader: "ts-loader",
},
{
test: /\.(html|svg)?$/,
loader: "text-loader",
},
{
test: /.(png|woff(2)?|eot|ttf)(\?[a-z0-9=\.]+)?$/,
type: "asset/inline",
},
],
},
resolve: {
alias: {
vue$: "vue/dist/vue.esm.js",
},
extensions: ["*", ".js", ".ts", ".json"],
},
performance: {
hints: false,
},
optimization: {
minimize: argv.mode === "production",
minimizer: [
new TerserPlugin({
terserOptions: {
format: {
comments: false,
},
},
extractComments: false,
parallel: true,
}),
],
splitChunks: {
chunks: "initial",
name: "vendor",
},
},
plugins: [
new HtmlWebpackPlugin({
favicon: "./resource/icon.png",
filename: "index.html",
template: "./resource/index.html",
}),
new CleanWebpackPlugin({
dry: argv.mode !== "production",
}),
],
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。