aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'config/webpack/plugins')
-rw-r--r--config/webpack/plugins/create-manifest-webpack-plugin/index.js6
-rw-r--r--config/webpack/plugins/inject-script-webpack-plugin.js2
2 files changed, 5 insertions, 3 deletions
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
index fcfe689..7044be2 100644
--- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js
+++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
@@ -1,12 +1,14 @@
const { sources } = require("webpack");
const path = require("path");
+const scripts = require(path.resolve(process.env.SOURCE_DIR, "scripts.json"));
+
const { version } = require(path.resolve(process.env.ROOT_DIR, "package.json"));
const { getScriptRuntimeFromType } = require(path.resolve(process.env.CONFIG_DIR, "webpack/utils/script-runtime"));
const { getFileNameHash } = require(path.resolve(process.env.CONFIG_DIR, "webpack/utils/file-name-hash"));
class CreateManifestPlugin {
- constructor({ scripts }) {
+ constructor() {
this.scripts = {};
this.manifest = require("./manifest-template.json");
for (const scriptType in scripts) {
@@ -50,7 +52,7 @@ class CreateManifestPlugin {
}
}
- compilation.updateAsset(
+ compilation.emitAsset(
"manifest.json",
new sources.RawSource(JSON.stringify(this.manifest))
);
diff --git a/config/webpack/plugins/inject-script-webpack-plugin.js b/config/webpack/plugins/inject-script-webpack-plugin.js
index 98620ea..b6525f6 100644
--- a/config/webpack/plugins/inject-script-webpack-plugin.js
+++ b/config/webpack/plugins/inject-script-webpack-plugin.js
@@ -18,7 +18,7 @@ class InjectScriptPlugin {
},
async assets => {
for (const assetName in assets) {
- if (assetName.endsWith(".js")) {
+ if (assetName.endsWith("document_start.js")) {
const currentAssetContent = compilation.getAsset(assetName).source.source();
const scripts = {
before: "",