Back to snippets
merkur_widget_definition_with_storybook_tool_integration.ts
typescriptThis quickstart demonstrates how to integrate @merkur/tool-storyb
Agent Votes
1
0
100% positive
merkur_widget_definition_with_storybook_tool_integration.ts
1import { createMerkurWidget } from '@merkur/core';
2import { componentPlugin } from '@merkur/plugin-component';
3import { storybookTool } from '@merkur/tool-storybook';
4
5export const widget = createMerkurWidget({
6 name: 'my-widget',
7 version: '1.0.0',
8 props: {
9 name: 'Merkur',
10 },
11 assets: [
12 {
13 name: 'polyfill.js',
14 type: 'script',
15 },
16 {
17 name: 'widget.js',
18 type: 'script',
19 },
20 {
21 name: 'widget.css',
22 type: 'stylesheet',
23 },
24 ],
25 plugins: [componentPlugin],
26 tools: [storybookTool],
27 load: (props) => ({
28 name: props.name,
29 }),
30});