12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- var TerserPlugin = require("terser-webpack-plugin");
- var devProxy = {};
- try {
- devProxy = require("./dev-proxy");
- } catch (error) {}
- var proxy = process.env.NODE_ENV === "production" ? {} : devProxy;
- // 配置手册: https://cli.vuejs.org/zh/config/#vue-config-js
- // electron-bulder配置:https://www.electron.build/configuration/contents#extrafiles
- var config = {
- // publicPath: './',
- devServer: {
- port: 8066
- },
- pluginOptions: {
- electronBuilder: {
- nodeIntegration: true,
- externals: [
- "cropperjs",
- "crypto",
- "gm",
- "imagemagick",
- "deepmerge",
- "node-xlsx",
- "log4js"
- ],
- builderOptions: {
- extraFiles: [
- "extra/encrypt/**",
- "extra/font/**",
- "extra/imagemagick/**",
- "extra/zxing/**",
- "extra/zxingA/**",
- "extra/artControl/**",
- "extra/database/org.rdb",
- "config.sample.json",
- "sense_shield_installer_pub_2.2.0.46331.exe"
- ],
- win: {
- target: "portable",
- 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 } }
- })
- ]
- }
- };
- }
- if (proxy && Object.keys(proxy).length) {
- config.devServer.proxy = proxy;
- }
- // 解决iview自定义主题导入less报错
- config.css = {
- loaderOptions: {
- less: {
- javascriptEnabled: true
- }
- }
- };
- module.exports = config;
|