Skip to content

Commit

Permalink
Merge pull request #28440 from storybookjs/norbert/cpc-add-components…
Browse files Browse the repository at this point in the history
…-cjs

CPC: Add `CJS` for `core/components`
  • Loading branch information
valentinpalkovic authored Jul 3, 2024
2 parents 8decdf1 + bd36625 commit 2b4487b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion code/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
},
"./components": {
"types": "./dist/components/index.d.ts",
"import": "./dist/components/index.js"
"import": "./dist/components/index.js",
"require": "./dist/components/index.cjs"
},
"./theming": {
"types": "./dist/theming/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion code/core/scripts/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const getEntries = (cwd: string) => {
define('src/preview-api/index.ts', ['browser', 'node'], true),
define('src/manager-api/index.ts', ['browser', 'node'], true, ['react']),
define('src/router/index.ts', ['browser', 'node'], true, ['react']),
define('src/components/index.ts', ['browser'], true, [
define('src/components/index.ts', ['browser', 'node'], true, [
'react',
'react-dom',
'@storybook/csf',
Expand Down
1 change: 1 addition & 0 deletions code/lib/cli/core/components/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@storybook/core/components');
3 changes: 2 additions & 1 deletion code/lib/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@
},
"./internal/components": {
"types": "./core/components/index.d.ts",
"import": "./core/components/index.js"
"import": "./core/components/index.js",
"require": "./core/components/index.cjs"
},
"./internal/theming": {
"types": "./core/theming/index.d.ts",
Expand Down

0 comments on commit 2b4487b

Please sign in to comment.