From d299def249e1868b2e56998ff2ead337fc1064e1 Mon Sep 17 00:00:00 2001 From: luciana-mendonca Date: Tue, 2 Aug 2022 13:21:29 +0200 Subject: [PATCH] build(addon-outline): use ts-up to build addon-outline --- code/addons/outline/manager.js | 2 +- code/addons/outline/package.json | 38 ++++++++++++++++++++++++++++---- code/addons/outline/preview.js | 2 +- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/code/addons/outline/manager.js b/code/addons/outline/manager.js index 4e287d25b151..8a2eae4ffce1 100644 --- a/code/addons/outline/manager.js +++ b/code/addons/outline/manager.js @@ -1 +1 @@ -import './dist/esm/manager'; +import './dist/manager'; diff --git a/code/addons/outline/package.json b/code/addons/outline/package.json index 8af78bcad423..00f8b29bf3fb 100644 --- a/code/addons/outline/package.json +++ b/code/addons/outline/package.json @@ -27,9 +27,32 @@ }, "license": "MIT", "author": "winkerVSbecks", - "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" + }, + "./manager": { + "require": "./dist/manager.js", + "import": "./dist/manager.mjs", + "types": "./dist/manager.d.ts" + }, + "./preview": { + "require": "./dist/preset/preview.js", + "import": "./dist/preset/preview.mjs", + "types": "./dist/preview.d.ts" + }, + "./register.js": { + "require": "./dist/manager.js", + "import": "./dist/manager.mjs", + "types": "./dist/manager.d.ts" + }, + "./package.json": "./package.json" + }, + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", "files": [ "dist/**/*", "README.md", @@ -38,7 +61,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prepare": "node ../../../scripts/prepare.js" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.17", @@ -69,6 +92,13 @@ "publishConfig": { "access": "public" }, + "bundler": { + "entries": [ + "./src/index.ts", + "./src/manager.tsx", + "./src/preset/preview.tsx" + ] + }, "gitHead": "7d44bfd3e759c6f17b75029ee2e067fab811f27b", "storybook": { "displayName": "Outline", diff --git a/code/addons/outline/preview.js b/code/addons/outline/preview.js index 7817e1d278d2..48714cc6fba3 100644 --- a/code/addons/outline/preview.js +++ b/code/addons/outline/preview.js @@ -1 +1 @@ -export * from './dist/esm/preset/preview'; +export * from './dist/preset/preview';