@imtf/profile-scripts 1.1.1 → 1.3.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,19 @@
2
2
 
3
3
  Here you can find a resume of all changes between versions.
4
4
 
5
+ ## 1.3.0
6
+
7
+ ### Features
8
+
9
+ - Imported CSS files are now inlined in the js once processed.
10
+
11
+ ## 1.2.0
12
+
13
+ ### Features
14
+
15
+ - `externalGlobal` parameter forwarded to `esbuild` to allow to use extra external
16
+ globals
17
+
5
18
  ## 1.1.1
6
19
 
7
20
  ### 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.3.0",
4
4
  "description": "Default scripts to bundle & transpile imtf front-end plugins",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -31,6 +31,7 @@
31
31
  "concurrently": "^8.0.1",
32
32
  "esbuild": "^0.18.6",
33
33
  "esbuild-plugin-external-global": "^1.0.1",
34
+ "esbuild-plugin-inline-css": "^0.0.1",
34
35
  "serve": "^14.1.2"
35
36
  },
36
37
  "devDependencies": {
@@ -1,5 +1,6 @@
1
1
  import { build, context } from "esbuild";
2
2
  import esbuild from "esbuild-plugin-external-global";
3
+ import InlineCSSPlugin from "esbuild-plugin-inline-css";
3
4
  import minimist from "minimist";
4
5
 
5
6
  // eslint-disable-next-line import/no-named-as-default-member
@@ -8,7 +9,18 @@ const externalGlobalPlugin = esbuild.externalGlobalPlugin;
8
9
  import notifierPlugin from "./notifierPlugin.mjs";
9
10
  import svgPlugin from "./svgPlugin.mjs";
10
11
 
11
- const { watch, entryPoint } = minimist(process.argv.slice(2));
12
+ const { watch, entryPoint, externalGlobal } = minimist(process.argv.slice(2));
13
+
14
+ const externalGlobals = externalGlobal
15
+ ? (typeof externalGlobal === "string"
16
+ ? [externalGlobal]
17
+ : externalGlobal
18
+ ).reduce((acc, curr) => {
19
+ const [key, value] = curr.split("=");
20
+ acc[key] = value;
21
+ return acc;
22
+ }, {})
23
+ : {};
12
24
 
13
25
  const entryPoints = entryPoint
14
26
  ? typeof entryPoint === "string"
@@ -46,12 +58,14 @@ const config = {
46
58
  },
47
59
 
48
60
  plugins: [
61
+ InlineCSSPlugin(),
49
62
  svgPlugin(),
50
63
  externalGlobalPlugin({
51
64
  react: "window.React",
52
65
  "react-dom": "window.ReactDOM",
53
66
  "react-router-dom": "window.reactRouterDom",
54
67
  IMTFPlugins: "window.IMTFPlugins",
68
+ ...externalGlobals,
55
69
  }),
56
70
  notifierPlugin(),
57
71
  ],