AA
aaronksaunders/storybookv7-ionic-angular
Simple demonstration of using storybook v7 with ionic framework
Simple Storybook v7 Angular Ionic Integration
Simple demonstration of using storybook v7 with ionic framework
Video
Setup
In project directory
npx storybook@latest init
Changes to angular.json
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"configDir": ".storybook",
"browserTarget": "app:build",
"compodoc": false,
"port": 6006,
"assets": [
{
"glob": "**/*",
"input": "src/assets",
"output": "assets"
},
{
"glob": "**/*.svg",
"input": "node_modules/ionicons/dist/ionicons/svg",
"output": "./svg"
}
],
"styles": [
"src/theme/variables.scss",
"src/global.scss"
]
}
},Specific Change to a basic story to support Angular & Ionic Framework
decorators: [
// include IonicModule
applicationConfig({
providers: [importProvidersFrom([IonicModule.forRoot()])],
}),
// declare the component
moduleMetadata({
declarations: [MemberCardComponent],
}),
// wrap in ion-app
componentWrapperDecorator((story) => `<ion-app>${story}</ion-app>`),
],More Information
Issues
Compile Error
Error: node_modules/webpack/types.d.ts:10934:41 - error TS2315: Type 'ServerOptions' is not generic.
10934 > = SecureContextOptions & TlsOptions & ServerOptionsImport<Request, Response>;
I resolved it by using "skipLibCheck": true in your tsconfig.app.json under "compilerOptions"
On this page
Languages
TypeScript58.9%SCSS23.6%HTML6.8%CSS6.7%JavaScript4.0%
Contributors
Created May 15, 2023
Updated May 24, 2024