Sfoglia il codice sorgente

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

louhangfei 2 anni fa
parent
commit
90e53771ae
1 ha cambiato i file con 7 aggiunte e 7 eliminazioni
  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);