@imtf/profile-scripts 1.5.0-beta.1 → 1.5.0-beta.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.
package/changelog.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  Here you can find a resume of all changes between versions.
4
4
 
5
+ ## 1.5.0
6
+
7
+ ### Features
8
+
9
+ - CSS Modules are now supported. You can use the `*.module.css` extension to
10
+ enable CSS Modules. The generated class names will be hashed and available
11
+ in the JS file.
12
+
13
+ ## 1.4.0
14
+
15
+ ### Features
16
+
17
+ - Sourcemaps are now generated for the built files.
18
+
5
19
  ## 1.3.0
6
20
 
7
21
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imtf/profile-scripts",
3
- "version": "1.5.0-beta.1",
3
+ "version": "1.5.0-beta.3",
4
4
  "description": "Default scripts to bundle & transpile imtf front-end plugins",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -13,9 +13,7 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "build": "NODE_ENV=production node scripts/esbuild.mjs --entryPoint=index.tsx",
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\""
16
+ "start": "node scripts/esbuild.mjs --entryPoint=index.tsx --watch"
19
17
  },
20
18
  "prettier": "@imtf/prettier-config",
21
19
  "license": "UNLICENSED",
@@ -24,12 +22,11 @@
24
22
  "@svgr/core": "^8.1.0",
25
23
  "@svgr/plugin-jsx": "^8.1.0",
26
24
  "@svgr/plugin-svgo": "^8.1.0",
27
- "concurrently": "^9.0.0",
28
25
  "esbuild": "^0.24.0",
29
26
  "esbuild-css-modules-plugin": "^3.1.4",
30
27
  "esbuild-plugin-external-global": "^1.0.1",
31
28
  "esbuild-plugin-inline-css": "^0.0.1",
32
29
  "minimist": "^1.2.8",
33
- "serve": "^14.2.4"
30
+ "serve-handler": "^6.1.6"
34
31
  }
35
32
  }
@@ -3,6 +3,8 @@ 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
8
 
7
9
  // eslint-disable-next-line import/no-named-as-default-member
8
10
  const externalGlobalPlugin = esbuild.externalGlobalPlugin;
@@ -71,7 +73,7 @@ const config = {
71
73
  IMTFPlugins: "window.IMTFPlugins",
72
74
  ...externalGlobals,
73
75
  }),
74
- notifierPlugin(),
76
+ notifierPlugin(watch),
75
77
  ],
76
78
  };
77
79
 
@@ -81,10 +83,10 @@ if (watch) {
81
83
  // Enable watch mode
82
84
  await ctx.watch();
83
85
 
84
- // // Enable serve mode
85
- // await ctx.serve({
86
- // port: 3010,
87
- // });
86
+ // 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"));
88
90
  } else {
89
91
  build(config);
90
92
  }
@@ -1,4 +1,4 @@
1
- const notifierPlugin = () => ({
1
+ const notifierPlugin = (watch) => ({
2
2
  name: "svgr",
3
3
  setup(build) {
4
4
  let count = 0;
@@ -9,7 +9,11 @@ const notifierPlugin = () => ({
9
9
  }
10
10
 
11
11
  if (count++ === 0) {
12
- console.log(`1st build: ${new Date().getTime()}`);
12
+ if(watch) {
13
+ console.log(`1st build: ${new Date().getTime()}`);
14
+ } else {
15
+ console.log(`Successfully built`);
16
+ }
13
17
  } else {
14
18
  console.log(`Rebuilt: ${new Date().getTime()}`);
15
19
  }