aboutsummaryrefslogtreecommitdiffstats
path: root/config/webpack/loader
diff options
context:
space:
mode:
Diffstat (limited to 'config/webpack/loader')
-rw-r--r--config/webpack/loader/arrange-shared-module-loader.js9
-rw-r--r--config/webpack/loader/count-imports-loader.js7
-rw-r--r--config/webpack/loader/to-string-loader.js2
3 files changed, 8 insertions, 10 deletions
diff --git a/config/webpack/loader/arrange-shared-module-loader.js b/config/webpack/loader/arrange-shared-module-loader.js
index 1669a64..2265185 100644
--- a/config/webpack/loader/arrange-shared-module-loader.js
+++ b/config/webpack/loader/arrange-shared-module-loader.js
@@ -1,10 +1,9 @@
-const path = require("path");
+import path from "path";
+import { ImportManager } from "import-manager";
-const { ImportManager } = require("import-manager");
+import sharedModules from "../utils/shared-modules.js";
-const sharedModules = webpackRequire("utils/shared-modules.js");
-
-module.exports = function(source) {
+export default function(source) {
const currentSharedModuleName = path.basename(this.resourcePath.substring(0, this.resourcePath.length - 3));
if (sharedModules.includes(currentSharedModuleName)) {
diff --git a/config/webpack/loader/count-imports-loader.js b/config/webpack/loader/count-imports-loader.js
index 4c3faa4..2586332 100644
--- a/config/webpack/loader/count-imports-loader.js
+++ b/config/webpack/loader/count-imports-loader.js
@@ -1,8 +1,7 @@
-const { ImportManager } = require("import-manager");
+import { ImportManager } from "import-manager";
+import sharedModules from "../utils/shared-modules.js";
-const sharedModules = webpackRequire("utils/shared-modules.js");
-
-module.exports = function(source) {
+export default function(source) {
const { sharedModulesImportedCount } = this.getOptions();
const manager = new ImportManager(source);
diff --git a/config/webpack/loader/to-string-loader.js b/config/webpack/loader/to-string-loader.js
index cf26b28..248574a 100644
--- a/config/webpack/loader/to-string-loader.js
+++ b/config/webpack/loader/to-string-loader.js
@@ -1,4 +1,4 @@
-module.exports = function(source) {
+export default function(source) {
source = source
.replaceAll("\\", "\\\\")
.replaceAll("`","\\`")