Explorar el Código

修改打包后的app.config.js代码不压缩

louhangfei hace 2 años
padre
commit
90e53771ae
Se han modificado 1 ficheros con 7 adiciones y 7 borrados
  1. 7 7
      build/script/buildConf.ts

+ 7 - 7
build/script/buildConf.ts

@@ -20,13 +20,13 @@ function createConfig(
   try {
     const windowConf = `window.${configName}`;
     // Ensure that the variable will not be modified
-    const configStr = `${windowConf}=${JSON.stringify(config)};
-      Object.freeze(${windowConf});
-      Object.defineProperty(window, "${configName}", {
-        configurable: false,
-        writable: false,
-      });
-    `.replace(/\s/g, '');
+    const configStr = `
+${windowConf}=${JSON.stringify(config, null, 2)};
+Object.freeze(${windowConf});
+Object.defineProperty(window, "${configName}", {
+  configurable: false,
+  writable: false,
+});`;
     fs.mkdirp(getRootPath(OUTPUT_DIR));
     writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);