const { defineConfig } = require("@vue/cli-service"); module.exports = defineConfig({ devServer: { client: { overlay: false }, proxy: { //开发环境代理配置 "/api": { target: "http://192.168.110.34:9090", changeOrigin: true, pathRewrite: { "^/api": "/api" } }, } }, transpileDependencies: true, pluginOptions: { electronBuilder: { customFileProtocol: "./", nodeIntegration: true, preload: 'src/preload.js', externals: [ "core-js", "electron-log", "qrcode", "soap", "view-design", "vue", "vue-router", "vuex", "x2js", "@rongcloud/electron", "@rongcloud/engine", "@rongcloud/imlib-next", "@rongcloud/electron-renderer", "@rongcloud/imkit", "axios", "element-ui", "js-md5", "js-pinyin", "moment", // "register-service-worker", ], builderOptions: { appId: "com.example.app", buildDependenciesFromSource: true, // "asarUnpack": [ // "./node_modules/java", // "./node_modules/async", // ], asar: "false", productName: "scan", //项目名,也是生成的安装文件名,即aDemo.exe copyright: "Copyright © 2020", //版权信息 directories: { // output: "./dist", //输出文件路径 }, win: { //win相关配置 icon: "./public/logo.png", //图标,当前图标在根目录下,注意这里有两个坑 target: [ { target: "nsis", //利用nsis制作安装程序 arch: [ "x64", //64位 "ia32", //32位 ], }, ], }, mac: { target: ["dmg", "zip"], }, // "linux": { // "icon": "./public/favicon.ico" // }, nsis: { oneClick: false, // 是否一键安装 allowElevation: true, // 允许请求提升。 如果为false,则用户必须使用提升的权限重新启动安装程序。 allowToChangeInstallationDirectory: true, // 允许修改安装目录 createDesktopShortcut: true, // 创建桌面图标 createStartMenuShortcut: true, // 创建开始菜单图标 shortcutName: "scan", // 图标名称 }, }, }, }, chainWebpack(config) { config.module .rule("vue") .use("vue-loader") .tap((options) => { options.compilerOptions = { ...options.compilerOptions, isCustomElement: (tag) => { return ( ["conversation-list", "message-list", "message-editor"].indexOf( tag ) !== -1 ); }, }; return options; }) .end(); }, });