Closed tylergaw closed 7 months ago
This adds an entry in package.json to export package.json.
package.json
Why?
I'm using addon-svelte-csf in a monorepo where I need to find the absolute path of a package in .storybook/main.js. A simplified version:
addon-svelte-csf
.storybook/main.js
addons: [ dirname(require.resolve(join('@storybook/addon-svelte-csf', 'package.json'))) ]
What happens currently?
Without the exported package.json, we hit an error attempting to get it
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined by "exports"
Is this normal?
I think so. Looking at other official addons, it looks common to export package.json. Examples:
Again, this seems OK to do, but I am a little hazy on how the exports setup is supposed to work, so this may not be the right way to do this.
exports
:rocket: PR was released in v4.0.12 :rocket:
v4.0.12
Excellent, thanks for the fast turnaround @JReinhold @shilman!
This adds an entry in
package.json
to exportpackage.json
.Why?
I'm using
addon-svelte-csf
in a monorepo where I need to find the absolute path of a package in.storybook/main.js
. A simplified version:What happens currently?
Without the exported
package.json
, we hit an error attempting to get itIs this normal?
I think so. Looking at other official addons, it looks common to export
package.json
. Examples:Again, this seems OK to do, but I am a little hazy on how the
exports
setup is supposed to work, so this may not be the right way to do this.