|
@@ -1,66 +1,67 @@
|
|
-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: {
|
|
|
|
- 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;
|
|
|
|
|
|
+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: {
|
|
|
|
+ externals: ["node-xlsx"],
|
|
|
|
+ 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;
|