I have a angular [email protected] app (no ejected webpack) and I can't write a story for components that use css import with a @
char.
ng new app
cd app
getStorybook
write a component that use imports with '@' such as @import '~@angular/material/theming';
write a story for that component
@storybook/[email protected]
@storybook/[email protected]
@storybook/[email protected]
@storybook/[email protected]
@storybook/[email protected]
@angular/[email protected]
@angular/[email protected]
// code here
Can you please check the v3.4.0-alpha.9?
Yeah we added scss support by default for angular right?
now I'm getting:
ERROR in ./src/root/app/common/breadcrumbs.component.ts
[tsl] ERROR in <project-path>\src\root\app\common\my-components.component.ts(24,12)
TS2304: Cannot find name 'require'.
Child html-webpack-plugin for "index.html":
line 24 is the styleUrls
Yeah we added scss support by default for angular right?
Yeah, but more important is an integration with the css part of the angular-cli's
webpack.config.
do you have a public repo with this issue?
https://github.com/amitport/storybook-issue-3165
ng new --minimal
followed by getStorybook
and using styleUrls
Adding @types/node
as a devDep solved it form me
@igor-dv that does work,
1 so, this probably should be documented or added with getStrorybook
2 I'm getting an error from ng serve
: ERROR in node_modules/@storybook/angular/index.d.ts(31,44): error TS2304: Cannot find name 'NodeRequire'
.
(seems that @angular/[email protected]
+ storbybook
is a little broken- I can add this in a different issue though)
I think you need to exclude stories from your regular tsconig, and add a custom tsconfig to the .storybook
dir that overrides this exclusion.
adding
"exclude": [
"test.ts",
"**/*.spec.ts",
"stories"
]
to src/tsconfig.app.json
seems to work
for me just stories
didn't work. Had to do "**/*.stories.ts"
@amitport is probably using the stories
dir to put all the stories in.
Most helpful comment
adding
to
src/tsconfig.app.json
seems to work