From 5bee39d850e42743c2396f2a1eb2891a8c7e3ff9 Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Fri, 10 Feb 2023 11:18:26 +0530 Subject: Using global object instead of process.env for common directory paths. --- config/webpack/loaders/scoped-loader.js | 2 +- config/webpack/plugins/create-manifest-webpack-plugin/index.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'config/webpack') diff --git a/config/webpack/loaders/scoped-loader.js b/config/webpack/loaders/scoped-loader.js index 1be58a4..c2f9636 100644 --- a/config/webpack/loaders/scoped-loader.js +++ b/config/webpack/loaders/scoped-loader.js @@ -1,6 +1,6 @@ const path = require("path"); -const scripts = require(path.resolve(process.env.SOURCE_DIR, "scripts.json")); +const scripts = require(path.resolve(SOURCE_DIR, "scripts.json")); const getScriptType = scriptName => { for (const scriptType in scripts) { diff --git a/config/webpack/plugins/create-manifest-webpack-plugin/index.js b/config/webpack/plugins/create-manifest-webpack-plugin/index.js index 2e121da..7852d62 100644 --- a/config/webpack/plugins/create-manifest-webpack-plugin/index.js +++ b/config/webpack/plugins/create-manifest-webpack-plugin/index.js @@ -1,16 +1,16 @@ const { sources } = require("webpack"); const path = require("path"); -const scripts = require(path.resolve(process.env.SOURCE_DIR, "scripts.json")); +const scripts = require(path.resolve(SOURCE_DIR, "scripts.json")); -const { version } = require(path.resolve(process.env.ROOT_DIR, "package.json")); +const { version } = require(path.resolve(ROOT_DIR, "package.json")); const { getScriptRuntimeFromType } = webpackRequire("utils/script-runtime"); const { getFileNameHash } = webpackRequire("utils/file-name-hash"); class CreateManifestPlugin { constructor() { this.scripts = {}; - this.manifest = require("./manifest-template.json"); + this.manifest = webpackRequire("plugins/create-manifest-webpack-plugin/manifest-template.json"); for (const scriptType in scripts) { const scriptRuntime = getScriptRuntimeFromType(scriptType); this.scripts[scriptRuntime] = { ...this.scripts[scriptRuntime], ...scripts[scriptType] }; -- cgit v1.2.3