diff --git a/frameworks/html-webpack5/package.json b/frameworks/html-webpack5/package.json
index 040becf86d2e..31b4016a4299 100644
--- a/frameworks/html-webpack5/package.json
+++ b/frameworks/html-webpack5/package.json
@@ -19,9 +19,26 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
- "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"
+ },
+ "./preset": {
+ "require": "./dist/preset.js",
+ "import": "./dist/preset.mjs",
+ "types": "./dist/preset.d.ts"
+ },
+ "./package.json": {
+ "require": "./package.json",
+ "import": "./package.json",
+ "types": "./package.json"
+ }
+ },
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
"files": [
"dist/**/*",
"README.md",
@@ -29,7 +46,7 @@
"*.d.ts"
],
"scripts": {
- "prepare": "node ../../scripts/prepare.js"
+ "prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-alpha.6",
@@ -42,6 +59,9 @@
"react": "16.14.0",
"react-dom": "16.14.0"
},
+ "devDependencies": {
+ "@digitak/esrun": "^3.2.2"
+ },
"peerDependencies": {
"@babel/core": "*"
},
@@ -51,5 +71,9 @@
"publishConfig": {
"access": "public"
},
+ "bundlerEntrypoint": [
+ "./src/index.ts",
+ "./src/preset.ts"
+ ],
"gitHead": "a88dcca40ba169a373bad33dd76e9a4bd4f1f5ec"
}
diff --git a/frameworks/html-webpack5/preset.js b/frameworks/html-webpack5/preset.js
index e45ac5b4cec0..a83f95279e7f 100644
--- a/frameworks/html-webpack5/preset.js
+++ b/frameworks/html-webpack5/preset.js
@@ -1 +1 @@
-module.exports = require('./dist/cjs/preset');
+module.exports = require('./dist/preset');
diff --git a/frameworks/preact-webpack5/package.json b/frameworks/preact-webpack5/package.json
index 8b7ab4ae9240..abd6053477bd 100644
--- a/frameworks/preact-webpack5/package.json
+++ b/frameworks/preact-webpack5/package.json
@@ -19,9 +19,26 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
- "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"
+ },
+ "./preset": {
+ "require": "./dist/preset.js",
+ "import": "./dist/preset.mjs",
+ "types": "./dist/preset.d.ts"
+ },
+ "./package.json": {
+ "require": "./package.json",
+ "import": "./package.json",
+ "types": "./package.json"
+ }
+ },
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
"files": [
"dist/**/*",
"README.md",
@@ -29,7 +46,7 @@
"*.d.ts"
],
"scripts": {
- "prepare": "node ../../scripts/prepare.js"
+ "prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-alpha.6",
@@ -42,6 +59,7 @@
"react-dom": "16.14.0"
},
"devDependencies": {
+ "@digitak/esrun": "^3.2.2",
"preact": "^10.5.13"
},
"peerDependencies": {
@@ -54,5 +72,9 @@
"publishConfig": {
"access": "public"
},
+ "bundlerEntrypoint": [
+ "./src/index.ts",
+ "./src/preset.ts"
+ ],
"gitHead": "a88dcca40ba169a373bad33dd76e9a4bd4f1f5ec"
}
diff --git a/frameworks/preact-webpack5/preset.js b/frameworks/preact-webpack5/preset.js
index e45ac5b4cec0..a83f95279e7f 100644
--- a/frameworks/preact-webpack5/preset.js
+++ b/frameworks/preact-webpack5/preset.js
@@ -1 +1 @@
-module.exports = require('./dist/cjs/preset');
+module.exports = require('./dist/preset');
diff --git a/frameworks/react-webpack5/package.json b/frameworks/react-webpack5/package.json
index 205a41a13c43..09bf20244b0b 100644
--- a/frameworks/react-webpack5/package.json
+++ b/frameworks/react-webpack5/package.json
@@ -19,9 +19,26 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
- "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"
+ },
+ "./preset": {
+ "require": "./dist/preset.js",
+ "import": "./dist/preset.mjs",
+ "types": "./dist/preset.d.ts"
+ },
+ "./package.json": {
+ "require": "./package.json",
+ "import": "./package.json",
+ "types": "./package.json"
+ }
+ },
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
"files": [
"dist/**/*",
"types/**/*",
@@ -30,7 +47,7 @@
"*.d.ts"
],
"scripts": {
- "prepare": "node ../../scripts/prepare.js"
+ "prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-alpha.6",
@@ -40,6 +57,7 @@
"core-js": "^3.8.2"
},
"devDependencies": {
+ "@digitak/esrun": "^3.2.2",
"jest-specific-snapshot": "^4.0.0"
},
"peerDependencies": {
@@ -61,5 +79,9 @@
"publishConfig": {
"access": "public"
},
+ "bundlerEntrypoint": [
+ "./src/index.ts",
+ "./src/preset.ts"
+ ],
"gitHead": "a88dcca40ba169a373bad33dd76e9a4bd4f1f5ec"
}
diff --git a/frameworks/react-webpack5/preset.js b/frameworks/react-webpack5/preset.js
index e45ac5b4cec0..a83f95279e7f 100644
--- a/frameworks/react-webpack5/preset.js
+++ b/frameworks/react-webpack5/preset.js
@@ -1 +1 @@
-module.exports = require('./dist/cjs/preset');
+module.exports = require('./dist/preset');
diff --git a/frameworks/server-webpack5/package.json b/frameworks/server-webpack5/package.json
index da05a1370aee..5952ae56a7dc 100644
--- a/frameworks/server-webpack5/package.json
+++ b/frameworks/server-webpack5/package.json
@@ -19,9 +19,26 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
- "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"
+ },
+ "./preset": {
+ "require": "./dist/preset.js",
+ "import": "./dist/preset.mjs",
+ "types": "./dist/preset.d.ts"
+ },
+ "./package.json": {
+ "require": "./package.json",
+ "import": "./package.json",
+ "types": "./package.json"
+ }
+ },
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
"files": [
"dist/**/*",
"README.md",
@@ -29,7 +46,7 @@
"*.d.ts"
],
"scripts": {
- "prepare": "node ../../scripts/prepare.js"
+ "prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-alpha.6",
@@ -41,11 +58,18 @@
"react": "16.14.0",
"react-dom": "16.14.0"
},
+ "devDependencies": {
+ "@digitak/esrun": "^3.2.2"
+ },
"engines": {
"node": ">=10.13.0"
},
"publishConfig": {
"access": "public"
},
+ "bundlerEntrypoint": [
+ "./src/index.ts",
+ "./src/preset.ts"
+ ],
"gitHead": "a88dcca40ba169a373bad33dd76e9a4bd4f1f5ec"
}
diff --git a/frameworks/server-webpack5/preset.js b/frameworks/server-webpack5/preset.js
index e45ac5b4cec0..a83f95279e7f 100644
--- a/frameworks/server-webpack5/preset.js
+++ b/frameworks/server-webpack5/preset.js
@@ -1 +1 @@
-module.exports = require('./dist/cjs/preset');
+module.exports = require('./dist/preset');
diff --git a/frameworks/svelte-webpack5/package.json b/frameworks/svelte-webpack5/package.json
index 8ecc04f606c0..550f867e3b9a 100644
--- a/frameworks/svelte-webpack5/package.json
+++ b/frameworks/svelte-webpack5/package.json
@@ -19,9 +19,26 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
- "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"
+ },
+ "./preset": {
+ "require": "./dist/preset.js",
+ "import": "./dist/preset.mjs",
+ "types": "./dist/preset.d.ts"
+ },
+ "./package.json": {
+ "require": "./package.json",
+ "import": "./package.json",
+ "types": "./package.json"
+ }
+ },
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
"files": [
"dist/**/*",
"templates/**/*",
@@ -30,7 +47,7 @@
"*.d.ts"
],
"scripts": {
- "prepare": "node ../../scripts/prepare.js"
+ "prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-alpha.6",
@@ -42,6 +59,7 @@
"react-dom": "16.14.0"
},
"devDependencies": {
+ "@digitak/esrun": "^3.2.2",
"svelte": "^3.48.0",
"svelte-loader": "^3.1.2"
},
@@ -56,5 +74,9 @@
"publishConfig": {
"access": "public"
},
+ "bundlerEntrypoint": [
+ "./src/index.ts",
+ "./src/preset.ts"
+ ],
"gitHead": "a88dcca40ba169a373bad33dd76e9a4bd4f1f5ec"
}
diff --git a/frameworks/svelte-webpack5/preset.js b/frameworks/svelte-webpack5/preset.js
index e45ac5b4cec0..a83f95279e7f 100644
--- a/frameworks/svelte-webpack5/preset.js
+++ b/frameworks/svelte-webpack5/preset.js
@@ -1 +1 @@
-module.exports = require('./dist/cjs/preset');
+module.exports = require('./dist/preset');
diff --git a/frameworks/vue-webpack5/package.json b/frameworks/vue-webpack5/package.json
index eac59bb158b4..f2f8088cde14 100644
--- a/frameworks/vue-webpack5/package.json
+++ b/frameworks/vue-webpack5/package.json
@@ -19,9 +19,26 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
- "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"
+ },
+ "./preset": {
+ "require": "./dist/preset.js",
+ "import": "./dist/preset.mjs",
+ "types": "./dist/preset.d.ts"
+ },
+ "./package.json": {
+ "require": "./package.json",
+ "import": "./package.json",
+ "types": "./package.json"
+ }
+ },
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
"files": [
"dist/**/*",
"README.md",
@@ -29,7 +46,7 @@
"*.d.ts"
],
"scripts": {
- "prepare": "node ../../scripts/prepare.js"
+ "prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-alpha.6",
@@ -42,6 +59,7 @@
"react-dom": "16.14.0"
},
"devDependencies": {
+ "@digitak/esrun": "^3.2.2",
"vue": "^2.6.12",
"vue-loader": "^15.7.0",
"vue-template-compiler": "^2.6.14"
@@ -60,5 +78,9 @@
"publishConfig": {
"access": "public"
},
+ "bundlerEntrypoint": [
+ "./src/index.ts",
+ "./src/preset.ts"
+ ],
"gitHead": "a88dcca40ba169a373bad33dd76e9a4bd4f1f5ec"
}
diff --git a/frameworks/vue-webpack5/preset.js b/frameworks/vue-webpack5/preset.js
index e45ac5b4cec0..a83f95279e7f 100644
--- a/frameworks/vue-webpack5/preset.js
+++ b/frameworks/vue-webpack5/preset.js
@@ -1 +1 @@
-module.exports = require('./dist/cjs/preset');
+module.exports = require('./dist/preset');
diff --git a/frameworks/vue3-webpack5/package.json b/frameworks/vue3-webpack5/package.json
index 27abfb7063cd..d80350f19127 100644
--- a/frameworks/vue3-webpack5/package.json
+++ b/frameworks/vue3-webpack5/package.json
@@ -19,9 +19,26 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
- "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"
+ },
+ "./preset": {
+ "require": "./dist/preset.js",
+ "import": "./dist/preset.mjs",
+ "types": "./dist/preset.d.ts"
+ },
+ "./package.json": {
+ "require": "./package.json",
+ "import": "./package.json",
+ "types": "./package.json"
+ }
+ },
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
"files": [
"dist/**/*",
"README.md",
@@ -29,7 +46,7 @@
"*.d.ts"
],
"scripts": {
- "prepare": "node ../../scripts/prepare.js"
+ "prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@storybook/builder-webpack5": "7.0.0-alpha.6",
@@ -42,6 +59,7 @@
"react-dom": "16.14.0"
},
"devDependencies": {
+ "@digitak/esrun": "^3.2.2",
"@vue/compiler-sfc": "3.0.0",
"vue": "3.0.0"
},
@@ -57,5 +75,9 @@
"publishConfig": {
"access": "public"
},
+ "bundlerEntrypoint": [
+ "./src/index.ts",
+ "./src/preset.ts"
+ ],
"gitHead": "a88dcca40ba169a373bad33dd76e9a4bd4f1f5ec"
}
diff --git a/frameworks/vue3-webpack5/preset.js b/frameworks/vue3-webpack5/preset.js
index e45ac5b4cec0..a83f95279e7f 100644
--- a/frameworks/vue3-webpack5/preset.js
+++ b/frameworks/vue3-webpack5/preset.js
@@ -1 +1 @@
-module.exports = require('./dist/cjs/preset');
+module.exports = require('./dist/preset');
diff --git a/frameworks/web-components-webpack5/package.json b/frameworks/web-components-webpack5/package.json
index 39f0732bd5a0..7c8bbebd1230 100644
--- a/frameworks/web-components-webpack5/package.json
+++ b/frameworks/web-components-webpack5/package.json
@@ -21,9 +21,26 @@
"url": "https://opencollective.com/storybook"
},
"license": "MIT",
- "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"
+ },
+ "./preset": {
+ "require": "./dist/preset.js",
+ "import": "./dist/preset.mjs",
+ "types": "./dist/preset.d.ts"
+ },
+ "./package.json": {
+ "require": "./package.json",
+ "import": "./package.json",
+ "types": "./package.json"
+ }
+ },
+ "main": "dist/index.js",
+ "module": "dist/index.mjs",
+ "types": "dist/index.d.ts",
"files": [
"dist/**/*",
"README.md",
@@ -31,7 +48,7 @@
"*.d.ts"
],
"scripts": {
- "prepare": "node ../../scripts/prepare.js"
+ "prepare": "esrun ../../scripts/prepare/bundle.ts"
},
"dependencies": {
"@babel/preset-env": "^7.12.11",
@@ -45,6 +62,7 @@
"react-dom": "16.14.0"
},
"devDependencies": {
+ "@digitak/esrun": "^3.2.2",
"lit-html": "2.0.2"
},
"peerDependencies": {
@@ -56,5 +74,9 @@
"publishConfig": {
"access": "public"
},
+ "bundlerEntrypoint": [
+ "./src/index.ts",
+ "./src/preset.ts"
+ ],
"gitHead": "a88dcca40ba169a373bad33dd76e9a4bd4f1f5ec"
}
diff --git a/frameworks/web-components-webpack5/preset.js b/frameworks/web-components-webpack5/preset.js
index e45ac5b4cec0..a83f95279e7f 100644
--- a/frameworks/web-components-webpack5/preset.js
+++ b/frameworks/web-components-webpack5/preset.js
@@ -1 +1 @@
-module.exports = require('./dist/cjs/preset');
+module.exports = require('./dist/preset');
diff --git a/yarn.lock b/yarn.lock
index f7707978d0e7..d5709c9a3c54 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -8511,6 +8511,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/html-webpack5@workspace:frameworks/html-webpack5"
dependencies:
+ "@digitak/esrun": ^3.2.2
"@storybook/builder-webpack5": 7.0.0-alpha.6
"@storybook/core-common": 7.0.0-alpha.6
"@storybook/html": 7.0.0-alpha.6
@@ -8757,6 +8758,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/preact-webpack5@workspace:frameworks/preact-webpack5"
dependencies:
+ "@digitak/esrun": ^3.2.2
"@storybook/builder-webpack5": 7.0.0-alpha.6
"@storybook/core-common": 7.0.0-alpha.6
"@storybook/preact": 7.0.0-alpha.6
@@ -9045,6 +9047,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/react-webpack5@workspace:frameworks/react-webpack5"
dependencies:
+ "@digitak/esrun": ^3.2.2
"@storybook/builder-webpack5": 7.0.0-alpha.6
"@storybook/preset-react-webpack": 7.0.0-alpha.6
"@storybook/react": 7.0.0-alpha.6
@@ -9458,6 +9461,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/server-webpack5@workspace:frameworks/server-webpack5"
dependencies:
+ "@digitak/esrun": ^3.2.2
"@storybook/builder-webpack5": 7.0.0-alpha.6
"@storybook/core-common": 7.0.0-alpha.6
"@storybook/preset-server-webpack": 7.0.0-alpha.6
@@ -9533,6 +9537,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/svelte-webpack5@workspace:frameworks/svelte-webpack5"
dependencies:
+ "@digitak/esrun": ^3.2.2
"@storybook/builder-webpack5": 7.0.0-alpha.6
"@storybook/core-common": 7.0.0-alpha.6
"@storybook/preset-svelte-webpack": 7.0.0-alpha.6
@@ -9735,6 +9740,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/vue-webpack5@workspace:frameworks/vue-webpack5"
dependencies:
+ "@digitak/esrun": ^3.2.2
"@storybook/builder-webpack5": 7.0.0-alpha.6
"@storybook/core-common": 7.0.0-alpha.6
"@storybook/preset-vue-webpack": 7.0.0-alpha.6
@@ -9760,6 +9766,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@storybook/vue3-webpack5@workspace:frameworks/vue3-webpack5"
dependencies:
+ "@digitak/esrun": ^3.2.2
"@storybook/builder-webpack5": 7.0.0-alpha.6
"@storybook/core-common": 7.0.0-alpha.6
"@storybook/preset-vue3-webpack": 7.0.0-alpha.6
@@ -9831,6 +9838,7 @@ __metadata:
resolution: "@storybook/web-components-webpack5@workspace:frameworks/web-components-webpack5"
dependencies:
"@babel/preset-env": ^7.12.11
+ "@digitak/esrun": ^3.2.2
"@storybook/builder-webpack5": 7.0.0-alpha.6
"@storybook/core-common": 7.0.0-alpha.6
"@storybook/preset-web-components-webpack": 7.0.0-alpha.6