1 Star 0 Fork 1

周冒恩童鞋/vue2-threejs-urdf-electron

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vue.config.js 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
const { defineConfig } = require('@vue/cli-service')
const TerserPlugin = require("terser-webpack-plugin");
module.exports = defineConfig({
transpileDependencies: true,
// electron-builder配置
// pluginOptions: {
// electronBuilder: {
// builderOptions: {
// // 额外资源配置
// extraFiles: ["./conf"],
// },
// },
// },
lintOnSave: false,
productionSourceMap: false,
publicPath: './',
devServer: {
proxy: {
'/api': {
// target: "http://192.168.30.144:8125/", // node-server 外网
// target: "http://10.194.228.59:8125/", // node-server 内网
target: "http://139.9.136.42:8125/", // node-server 服务器
changeOrigin: true,
logLevel: 'debug',
ws: true,
pathRewrite: {
'^/api': '/',
},
},
'/static': {
target: "https://cdn.utonmos.com", //测试1
changeOrigin: true,
logLevel: 'debug',
ws: true,
pathRewrite: {
'^/static': '/static',
},
},
},
},
css: {
loaderOptions: {
sass: {
// additionalData: `@import "./src/assets/styles/common";`,
},
},
},
configureWebpack: config => {
config.resolve.alias = {
...config.resolve.alias,
'vue$': 'vue/dist/vue.esm.js'
}
// 重要!! 配置 操作node fs模块
// 为Electron启动添加Node相关配置
// config.target = 'electron-renderer';
// config.externals = {
// fs: 'commonjs fs'
// };
// console.log(process.env.IS_ELECTRON,'process.env.IS_ELECTRON')
if (process.env.NODE_ENV != 'development') {
config.optimization = {
minimize: true,
nodeEnv: false,
minimizer: [new TerserPlugin({
terserOptions: {
ecma: undefined,
warnings: false,
parse: {},
compress: {
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log'],//移除console
}
}
})]
}
} else {
// 为开发环境修改配置...
}
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/s4145211/vue2-threejs-urdf-electron.git
[email protected]:s4145211/vue2-threejs-urdf-electron.git
s4145211
vue2-threejs-urdf-electron
vue2-threejs-urdf-electron
master

搜索帮助