@imtf/profile-scripts 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/changelog.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  Here you can find a resume of all changes between versions.
4
4
 
5
+ ## 1.2.0
6
+
7
+ ### Features
8
+
9
+ - `externalGlobal` parameter forwarded to `esbuild` to allow to use extra external
10
+ globals
11
+
5
12
  ## 1.1.1
6
13
 
7
14
  ### Chores
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imtf/profile-scripts",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Default scripts to bundle & transpile imtf front-end plugins",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -8,7 +8,18 @@ const externalGlobalPlugin = esbuild.externalGlobalPlugin;
8
8
  import notifierPlugin from "./notifierPlugin.mjs";
9
9
  import svgPlugin from "./svgPlugin.mjs";
10
10
 
11
- const { watch, entryPoint } = minimist(process.argv.slice(2));
11
+ const { watch, entryPoint, externalGlobal } = minimist(process.argv.slice(2));
12
+
13
+ const externalGlobals = externalGlobal
14
+ ? (typeof externalGlobal === "string"
15
+ ? [externalGlobal]
16
+ : externalGlobal
17
+ ).reduce((acc, curr) => {
18
+ const [key, value] = curr.split("=");
19
+ acc[key] = value;
20
+ return acc;
21
+ }, {})
22
+ : {};
12
23
 
13
24
  const entryPoints = entryPoint
14
25
  ? typeof entryPoint === "string"
@@ -52,6 +63,7 @@ const config = {
52
63
  "react-dom": "window.ReactDOM",
53
64
  "react-router-dom": "window.reactRouterDom",
54
65
  IMTFPlugins: "window.IMTFPlugins",
66
+ ...externalGlobals,
55
67
  }),
56
68
  notifierPlugin(),
57
69
  ],