123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 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;
|