var TerserPlugin = require("terser-webpack-plugin"); // 配置手册: https://cli.vuejs.org/zh/config/#vue-config-js // electron-bulder配置:https://www.electron.build/configuration/contents#extrafiles var config = { // publicPath: './', devServer: { port: 8066, proxy: { "/api/": { target: process.env.VUE_APP_DEV_PROXY, changeOrigin: true } } }, pluginOptions: { electronBuilder: { nodeIntegration: true, externals: [ "cropperjs", "crypto", "gm", "imagemagick", "deepmerge", "node-xlsx", "log4js" ], builderOptions: { extraFiles: [ "extra/checkBlack/**", "extra/encrypt/**", "extra/font/**", "extra/imagemagick/**", "extra/zxing/**", "extra/zxingA/**", "extra/zxingB/**", "extra/artControl/**", "extra/database/org.rdb", "config.sample.json", "sense_shield_installer_pub_2.2.0.46331.exe", "vcredist_msvc2017_x86.exe", "CH341SER.EXE" ], win: { target: [ { target: "dir", // "dir" 表示 win-unpacked arch: ["x64"] // 可以指定 "x64", "ia32" 或 "arm64",根据需要选择 } ], signAndEditExecutable: false } } } } }; // compress配置手册:https://github.com/mishoo/UglifyJS2/tree/harmony#compress-options if (process.env.NODE_ENV === "production") { config.configureWebpack = { plugins: [], optimization: { minimizer: [ new TerserPlugin({ terserOptions: { compress: { drop_console: true } } }) ] } }; } // 解决iview自定义主题导入less报错 config.css = { loaderOptions: { less: { javascriptEnabled: true } } }; module.exports = config;