From 1a33b3aa4867dd25096d1dfc8919fe6b832b1ff8 Mon Sep 17 00:00:00 2001 From: wataru Date: Thu, 8 Sep 2022 09:17:22 +0900 Subject: [PATCH 1/4] Build libs/router with ts-up --- code/lib/router/package.json | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/code/lib/router/package.json b/code/lib/router/package.json index 74d846139c8c..341fdf9d1262 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -20,9 +20,17 @@ }, "license": "MIT", "sideEffects": false, - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "types": "dist/types/index.d.ts", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "types": "./dist/index.d.ts" + }, + "./package.json": "./package.json" + }, + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", "files": [ "dist/**/*", "README.md", @@ -31,7 +39,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prep": "ts-node ../../../scripts/prebundle.ts" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/client-logger": "7.0.0-alpha.31", @@ -55,5 +63,10 @@ "access": "public" }, "bundlerEntrypoint": "./src/index.ts", + "bundler": { + "entries": [ + "./src/index.ts" + ] + }, "gitHead": "02c013c33186479017098d532a18ff8654b91f1f" } From dfde87e5fe17d58971d1b96899eb7ad658d4f8bb Mon Sep 17 00:00:00 2001 From: wataru Date: Thu, 8 Sep 2022 09:39:31 +0900 Subject: [PATCH 2/4] Fix path of utils.js --- code/lib/router/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/router/utils.js b/code/lib/router/utils.js index c66ea93e8989..5703fb5fd91d 100644 --- a/code/lib/router/utils.js +++ b/code/lib/router/utils.js @@ -1 +1 @@ -export * from './dist/esm'; +export * from './dist'; From 4c43da6e4add349b88a306b1896fbffa30b4d4b0 Mon Sep 17 00:00:00 2001 From: wataru Date: Thu, 8 Sep 2022 09:58:57 +0900 Subject: [PATCH 3/4] Add platform field --- code/lib/router/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/code/lib/router/package.json b/code/lib/router/package.json index 341fdf9d1262..2076b6b21a70 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -64,6 +64,7 @@ }, "bundlerEntrypoint": "./src/index.ts", "bundler": { + "platform": "browser", "entries": [ "./src/index.ts" ] From 3f6780e9b74604a258cee96be5fc89c66da21a13 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 8 Sep 2022 15:25:44 +0200 Subject: [PATCH 4/4] add utils --- code/lib/router/package.json | 9 +++++++-- code/lib/router/utils.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/lib/router/package.json b/code/lib/router/package.json index 2076b6b21a70..9e7e55616892 100644 --- a/code/lib/router/package.json +++ b/code/lib/router/package.json @@ -26,6 +26,11 @@ "import": "./dist/index.mjs", "types": "./dist/index.d.ts" }, + "./utils": { + "require": "./dist/utils.js", + "import": "./dist/utils.mjs", + "types": "./dist/utils.d.ts" + }, "./package.json": "./package.json" }, "main": "dist/index.js", @@ -62,11 +67,11 @@ "publishConfig": { "access": "public" }, - "bundlerEntrypoint": "./src/index.ts", "bundler": { "platform": "browser", "entries": [ - "./src/index.ts" + "./src/index.ts", + "./src/utils.ts" ] }, "gitHead": "02c013c33186479017098d532a18ff8654b91f1f" diff --git a/code/lib/router/utils.js b/code/lib/router/utils.js index 5703fb5fd91d..e4ddc9027ee3 100644 --- a/code/lib/router/utils.js +++ b/code/lib/router/utils.js @@ -1 +1 @@ -export * from './dist'; +export * from './dist/index';