@imtf/profile-scripts 1.4.1 → 1.5.0-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imtf/profile-scripts",
3
- "version": "1.4.1",
3
+ "version": "1.5.0-beta.1",
4
4
  "description": "Default scripts to bundle & transpile imtf front-end plugins",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -13,7 +13,9 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "build": "NODE_ENV=production node scripts/esbuild.mjs --entryPoint=index.tsx",
16
- "start": "node scripts/esbuild.mjs --entryPoint=index.tsx --watch"
16
+ "watch": "node scripts/esbuild.mjs --entryPoint=index.tsx --watch",
17
+ "serve": "npx serve build -l 3010",
18
+ "start": "concurrently \"npm run watch\" \"npm run serve\""
17
19
  },
18
20
  "prettier": "@imtf/prettier-config",
19
21
  "license": "UNLICENSED",
@@ -24,8 +26,10 @@
24
26
  "@svgr/plugin-svgo": "^8.1.0",
25
27
  "concurrently": "^9.0.0",
26
28
  "esbuild": "^0.24.0",
29
+ "esbuild-css-modules-plugin": "^3.1.4",
27
30
  "esbuild-plugin-external-global": "^1.0.1",
28
31
  "esbuild-plugin-inline-css": "^0.0.1",
29
- "minimist": "^1.2.8"
32
+ "minimist": "^1.2.8",
33
+ "serve": "^14.2.4"
30
34
  }
31
35
  }
@@ -1,6 +1,7 @@
1
1
  import { build, context } from "esbuild";
2
2
  import esbuild from "esbuild-plugin-external-global";
3
3
  import InlineCSSPlugin from "esbuild-plugin-inline-css";
4
+ import CssModulesPlugin from "esbuild-css-modules-plugin";
4
5
  import minimist from "minimist";
5
6
 
6
7
  // eslint-disable-next-line import/no-named-as-default-member
@@ -37,15 +38,15 @@ const config = {
37
38
  platform: "browser",
38
39
  bundle: true,
39
40
  target: "es2020",
41
+ metafile: true,
40
42
 
41
- sourcemap: watch ? "linked" : "external",
43
+ sourcemap: "external",
42
44
 
43
45
  minify:
44
46
  process.env.NODE_ENV === "production" &&
45
47
  process.env.IMTF_MINIFY_WEBAPP !== "false",
46
48
 
47
49
  loader: {
48
- ".css": "text",
49
50
  // Enable JSX in .js files too
50
51
  ".js": "jsx",
51
52
  // Embed fonts
@@ -60,6 +61,7 @@ const config = {
60
61
  },
61
62
 
62
63
  plugins: [
64
+ CssModulesPlugin({ inject: true }),
63
65
  InlineCSSPlugin(),
64
66
  svgPlugin(),
65
67
  externalGlobalPlugin({
@@ -79,10 +81,10 @@ if (watch) {
79
81
  // Enable watch mode
80
82
  await ctx.watch();
81
83
 
82
- // Enable serve mode
83
- await ctx.serve({
84
- port: 3010,
85
- });
84
+ // // Enable serve mode
85
+ // await ctx.serve({
86
+ // port: 3010,
87
+ // });
86
88
  } else {
87
89
  build(config);
88
90
  }