|
@@ -20,13 +20,13 @@ function createConfig(
|
|
|
try {
|
|
try {
|
|
|
const windowConf = `window.${configName}`;
|
|
const windowConf = `window.${configName}`;
|
|
|
// Ensure that the variable will not be modified
|
|
// 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));
|
|
fs.mkdirp(getRootPath(OUTPUT_DIR));
|
|
|
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);
|
|
writeFileSync(getRootPath(`${OUTPUT_DIR}/${configFileName}`), configStr);
|
|
|
|
|
|