aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/webpack.config.js3
-rw-r--r--config/webpack/plugins/create-manifest-webpack-plugin/index.js2
-rw-r--r--config/webpack/utils/get-injection-code.js2
3 files changed, 5 insertions, 2 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 8e27b8a..31d838e 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -53,6 +53,9 @@ module.exports = {
}
]
},
+ optimization: {
+ minimize: process.env.NODE_ENV === "production"
+ },
plugins: [
new InjectScriptPlugin(),
new CopyPlugin({
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
index 6984955..1940c6e 100644
--- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js
+++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
@@ -52,7 +52,7 @@ class CreateManifestPlugin {
compilation.emitAsset(
"manifest.json",
- new sources.RawSource(JSON.stringify(manifest))
+ new sources.RawSource(JSON.stringify(manifest, undefined, process.env.NODE_ENV === "production" ? undefined : "\t"))
);
}
);
diff --git a/config/webpack/utils/get-injection-code.js b/config/webpack/utils/get-injection-code.js
index 71afa93..51d1c20 100644
--- a/config/webpack/utils/get-injection-code.js
+++ b/config/webpack/utils/get-injection-code.js
@@ -19,5 +19,5 @@ module.exports.getInjectionCode = (code, front) => {
? "t.innerHTML=i+t.innerHTML"
: "t.innerHTML+=i";
- return `(()=>{let e=new MutationObserver(()=>{let t=document.querySelector("head > script:nth-child(54)");if(t){let i=\`(()=>{${finalCode}})();\`;${concatenationCode},e.disconnect()}});e.observe(document,{childList:!0,subtree:!0})})();`;
+ return `(()=>{let e=new MutationObserver(()=>{let t=document.querySelector("head > script:nth-child(54)");if(t){let i=\`${finalCode}\`;${concatenationCode},e.disconnect()}});e.observe(document,{childList:!0,subtree:!0})})();`;
};