Skip to content

Commit

Permalink
fix: create dummy package.json for ESM compatibility (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez committed Nov 29, 2021
1 parent e11a6d5 commit 7915f30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ function generateStorybookFiles (options) {
fileName: path.join('storybook', 'nuxt-entry.js'),
options
})
// Dummy package.json is needed for workaround https://github.com/storybookjs/storybook/issues/11587
this.addTemplate({
src: path.resolve(templatesRoot, 'package-template.json'),
fileName: path.join('storybook', 'package.json'),
options
})
}

export function eject (options: StorybookOptions) {
Expand Down
3 changes: 3 additions & 0 deletions storybook/package-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "commonjs"
}

0 comments on commit 7915f30

Please sign in to comment.