| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- const { defineConfig } = require("@vue/cli-service");
- const Package = require("./package");
- const CompressionPlugin = require("compression-webpack-plugin");
- const { isEnvProduction, isEnvInterfaceJoinDebug } = require("@vci/vci/other/ijd");
- const path = require("node:path");
- module.exports = defineConfig({
- assetsDir: "assets",
- publicPath: "./",
- outputDir: Package.name + (isEnvInterfaceJoinDebug ? "-ijd" : ""),
- productionSourceMap: false,
- transpileDependencies: true,
- devServer: {
- port: 8888,
- host: "localhost"
- },
- chainWebpack: config => {
- config.resolve.alias
- .set("~", path.resolve(__dirname, "src"))
- ;
- config.module
- .rule("cursor")
- .test(/\.cur$/)
- .use("cursor")
- .loader("file-loader")
- .options({
- name: "assets/cur/[name].[hash:8].[ext]"
- });
- config
- .plugin("html")
- .tap(args => {
- args[0]["title-cn"] = Package["name-cn"];
- return args;
- });
- isEnvProduction && config.plugin("compress-gzip")
- .use(CompressionPlugin)
- .tap(args => {
- args[0] = {
- algorithm: "gzip",
- test: /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i,
- threshold: 2048,
- minRatio: 0.8
- };
- return args;
- });
- }
- });
|