@storybook/addon-svelte-csf
Version:
Allows to write stories in Svelte syntax
27 lines (26 loc) • 775 B
JavaScript
import pkg from '@storybook/addon-svelte-csf/package.json' with { type: 'json' };
/**
* The export is defined in the `package.json` export map
*/
export function createRuntimeStoriesImport() {
const imported = {
type: 'Identifier',
// WARN: Tempting to use `createRuntimeStories.name` here.
// It will break, because this function imports `*.svelte` files.
name: 'createRuntimeStories',
};
return {
type: 'ImportDeclaration',
source: {
type: 'Literal',
value: `${pkg.name}/internal/create-runtime-stories`,
},
specifiers: [
{
type: 'ImportSpecifier',
imported,
local: imported,
},
],
};
}