aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-04-06 22:17:13 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2023-04-06 22:32:09 +0530
commit0f8593da3e75b8d44399c5f04edf000555b7406a (patch)
tree4e1c5fbbd6a27d35b91a194525c9d5972dcf5cfb /config
parent26649f83873d9e01d23f2927f64155453918aec7 (diff)
downloadbanglar-bhumi-utils-0f8593da3e75b8d44399c5f04edf000555b7406a.tar.gz
banglar-bhumi-utils-0f8593da3e75b8d44399c5f04edf000555b7406a.zip
Now downloading plot information pdf as well.
Diffstat (limited to 'config')
-rw-r--r--config/webpack.config.js16
-rw-r--r--config/webpack/plugins/create-manifest-webpack-plugin/index.js2
-rw-r--r--config/webpack/utils/get-injection-code.js21
3 files changed, 29 insertions, 10 deletions
diff --git a/config/webpack.config.js b/config/webpack.config.js
index 629a373..78f4060 100644
--- a/config/webpack.config.js
+++ b/config/webpack.config.js
@@ -129,15 +129,7 @@ const uninjectedScriptConfiguration = merge(
commonOptions,
sharedModuleOptions,
{
- entry: uninjectedScriptEntries,
- plugins: [
- new CopyPlugin({
- patterns: [{
- from: path.resolve(ROOT_DIR, "static"),
- to: "./"
- }]
- })
- ]
+ entry: uninjectedScriptEntries
}
);
@@ -169,6 +161,12 @@ const sharedModulesConfiguration = merge(
{
entry: sharedModuleEntries,
plugins: [
+ new CopyPlugin({
+ patterns: [{
+ from: path.resolve(ROOT_DIR, "static"),
+ to: "./"
+ }]
+ }),
new CreateManifestPlugin({
sharedModulesImportedCount,
sortedSharedModules
diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
index 667f1de..2187a05 100644
--- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js
+++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js
@@ -17,7 +17,7 @@ class CreateManifestPlugin {
compilation.hooks.processAssets.tap(
{
name: "CreateManifestPlugin",
- stage: compiler.webpack.Compilation.PROCESS_ASSETS_ADDITIONAL,
+ stage: compiler.webpack.Compilation.PROCESS_ASSETS_STAGE_ANALYSE,
additionalAssets: true
},
assets => {
diff --git a/config/webpack/utils/get-injection-code.js b/config/webpack/utils/get-injection-code.js
index ec969c1..0a57ef9 100644
--- a/config/webpack/utils/get-injection-code.js
+++ b/config/webpack/utils/get-injection-code.js
@@ -1,9 +1,30 @@
+const insertAtIndex = (str, substring, index) => str.slice(0, index) + substring + str.slice(index);
+
module.exports.getInjectionCode = (code, front) => {
let finalCode = code
.replaceAll("\\", "\\\\")
.replaceAll("`","\\`")
.replaceAll("${", "\\${");
+ let i = 0;
+
+ while (true) {
+ i = finalCode.indexOf("chrome.runtime", i);
+
+ if (i < 0) {
+ break;
+ }
+
+ finalCode = insertAtIndex(finalCode, "\"${", i);
+ i = finalCode.indexOf(")", i) + 1;
+
+ if (i <= 0) {
+ break;
+ }
+
+ finalCode = insertAtIndex(finalCode, "}\"", i);
+ }
+
const concatenationCode = front
? "t.innerHTML=i+t.innerHTML"
: "t.innerHTML+=i";