From ffb04a295f537e581d9f49e3aec6309a1b2d061c Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Thu, 27 Oct 2022 23:11:18 +0200 Subject: [PATCH] migrate preview-web to tsup --- code/lib/preview-web/package.json | 21 +++++++++++++++++---- code/lib/preview-web/src/PreviewWeb.tsx | 2 -- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/code/lib/preview-web/package.json b/code/lib/preview-web/package.json index 34efd26215e..69eb8d9d32c 100644 --- a/code/lib/preview-web/package.json +++ b/code/lib/preview-web/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": "../../../scripts/node_modules/.bin/tsc --noEmit", - "prep": "node ../../../scripts/prepare.js" + "prep": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.44", @@ -57,5 +65,10 @@ "publishConfig": { "access": "public" }, + "bundler": { + "entries": [ + "./src/index.ts" + ] + }, "gitHead": "d4965bd328d8f83c279560c7bc8428e490b275f3" } diff --git a/code/lib/preview-web/src/PreviewWeb.tsx b/code/lib/preview-web/src/PreviewWeb.tsx index 71185cfaa8a..98d03eb46f6 100644 --- a/code/lib/preview-web/src/PreviewWeb.tsx +++ b/code/lib/preview-web/src/PreviewWeb.tsx @@ -64,8 +64,6 @@ export class PreviewWeb extends Preview;