@imtf/profile-scripts 1.5.0 → 1.5.3

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.
@@ -23,7 +23,7 @@ switch (script) {
23
23
 
24
24
  const child = spawn.sync("node", processArgs, {
25
25
  stdio: "inherit",
26
- env: { ...process.env, NODE_ENV: "production" },
26
+ env: process.env,
27
27
  });
28
28
 
29
29
  if (child.signal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imtf/profile-scripts",
3
- "version": "1.5.0",
3
+ "version": "1.5.3",
4
4
  "description": "Default scripts to bundle & transpile imtf front-end plugins",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -12,8 +12,8 @@
12
12
  "changelog.md"
13
13
  ],
14
14
  "scripts": {
15
- "build": "NODE_ENV=production node scripts/esbuild.mjs --entryPoint=index.tsx",
16
- "start": "node scripts/esbuild.mjs --entryPoint=index.tsx --watch"
15
+ "build": "NODE_ENV=production node scripts/esbuild.mjs --entryPoint=src/index.tsx",
16
+ "start": "node scripts/esbuild.mjs --entryPoint=src/index.tsx --watch"
17
17
  },
18
18
  "prettier": "@imtf/prettier-config",
19
19
  "license": "UNLICENSED",
@@ -22,11 +22,11 @@
22
22
  "@svgr/core": "^8.1.0",
23
23
  "@svgr/plugin-jsx": "^8.1.0",
24
24
  "@svgr/plugin-svgo": "^8.1.0",
25
- "esbuild": "^0.24.0",
25
+ "esbuild": "^0.27.0",
26
26
  "esbuild-css-modules-plugin": "^3.1.4",
27
27
  "esbuild-plugin-external-global": "^1.0.1",
28
28
  "esbuild-plugin-inline-css": "^0.0.1",
29
- "minimist": "^1.2.8",
30
- "serve-handler": "^6.1.6"
29
+ "http-server": "^14.1.1",
30
+ "minimist": "^1.2.8"
31
31
  }
32
32
  }
@@ -3,8 +3,7 @@ import esbuild from "esbuild-plugin-external-global";
3
3
  import InlineCSSPlugin from "esbuild-plugin-inline-css";
4
4
  import CssModulesPlugin from "esbuild-css-modules-plugin";
5
5
  import minimist from "minimist";
6
- import handler from "serve-handler";
7
- import http from "http";
6
+ import HttpServer from "http-server";
8
7
 
9
8
  // eslint-disable-next-line import/no-named-as-default-member
10
9
  const externalGlobalPlugin = esbuild.externalGlobalPlugin;
@@ -12,7 +11,12 @@ const externalGlobalPlugin = esbuild.externalGlobalPlugin;
12
11
  import notifierPlugin from "./notifierPlugin.mjs";
13
12
  import svgPlugin from "./svgPlugin.mjs";
14
13
 
15
- const { watch, entryPoint, externalGlobal } = minimist(process.argv.slice(2));
14
+ const {
15
+ watch,
16
+ entryPoint,
17
+ externalGlobal,
18
+ outbase = "src",
19
+ } = minimist(process.argv.slice(2));
16
20
 
17
21
  const externalGlobals = externalGlobal
18
22
  ? (typeof externalGlobal === "string"
@@ -36,17 +40,16 @@ const entryPoints = entryPoint
36
40
  */
37
41
  const config = {
38
42
  entryPoints,
43
+ outbase,
39
44
  outdir: "build",
40
45
  platform: "browser",
41
46
  bundle: true,
42
- target: "es2020",
47
+ target: "es2024",
43
48
  metafile: true,
44
49
 
45
50
  sourcemap: watch ? "linked" : "external",
46
51
 
47
- minify:
48
- process.env.NODE_ENV === "production" &&
49
- process.env.IMTF_MINIFY_WEBAPP !== "false",
52
+ minify: watch === true ? false : process.env.IMTF_MINIFY_WEBAPP !== "false",
50
53
 
51
54
  loader: {
52
55
  // Enable JSX in .js files too
@@ -84,9 +87,8 @@ if (watch) {
84
87
  await ctx.watch();
85
88
 
86
89
  // Create a server for the build directory
87
- http
88
- .createServer((...params) => handler(...params, { public: "build" }))
89
- .listen(3010, () => console.log("Running at http://localhost:3010"));
90
+ const server = HttpServer.createServer({ root: "build" });
91
+ server.listen(3010, () => console.log("Running at http://localhost:3010"));
90
92
  } else {
91
- build(config);
93
+ await build(config);
92
94
  }