diff --git a/code/addons/viewport/manager.js b/code/addons/viewport/manager.js index 4e287d25b151..8a2eae4ffce1 100644 --- a/code/addons/viewport/manager.js +++ b/code/addons/viewport/manager.js @@ -1 +1 @@ -import './dist/esm/manager'; +import './dist/manager'; diff --git a/code/addons/viewport/package.json b/code/addons/viewport/package.json index 26e8fc700623..22db598b2462 100644 --- a/code/addons/viewport/package.json +++ b/code/addons/viewport/package.json @@ -22,9 +22,32 @@ "url": "https://opencollective.com/storybook" }, "license": "MIT", - "main": "dist/cjs/preview.js", - "module": "dist/esm/preview.js", - "types": "dist/types/preview.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/preview.ts", + "import": "./dist/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", @@ -33,7 +56,7 @@ ], "scripts": { "check": "tsc --noEmit", - "prepare": "node ../../../scripts/prepare.js" + "prepare": "../../../scripts/prepare/bundle.ts" }, "dependencies": { "@storybook/addons": "7.0.0-alpha.20", @@ -65,6 +88,14 @@ "publishConfig": { "access": "public" }, + "bundler": { + "entries": [ + "./src/index.ts", + "./src/models/index.ts", + "./src/manager.tsx", + "./src/preview.ts" + ] + }, "gitHead": "a6c00d2ebed21da54b4772b4a4f7fed9258f0ab4", "storybook": { "displayName": "Viewport", diff --git a/code/addons/viewport/src/index.ts b/code/addons/viewport/src/index.ts new file mode 100644 index 000000000000..341f696ad7b5 --- /dev/null +++ b/code/addons/viewport/src/index.ts @@ -0,0 +1,3 @@ +export * from './constants'; +export * from './defaults'; +export * from './shortcuts';