Enabling support for components with separate templates/css

Signed-off-by: Carlos Vega <clmvega@gmail.com>
This commit is contained in:
Carlos Vega 2017-07-25 10:10:53 -06:00 committed by Norbert de Langen
parent edbba98f0e
commit a8e8ed4600
3 changed files with 15 additions and 1 deletions

View File

@ -33,6 +33,7 @@
"@storybook/channel-postmessage": "^3.1.6",
"@storybook/ui": "^3.2.0-alpha.7",
"airbnb-js-shims": "^1.1.1",
"angular2-template-loader": "^0.6.2",
"autoprefixer": "^7.1.1",
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
@ -61,6 +62,7 @@
"postcss-loader": "^2.0.5",
"prop-types": "^15.5.10",
"qs": "^6.4.0",
"raw-loader": "^0.5.1",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-modal": "^1.7.7",

View File

@ -43,7 +43,12 @@ export default function() {
},
{
test: /\.ts?$/,
loader: require.resolve('ts-loader'),
loaders: [require.resolve('ts-loader'), require.resolve('angular2-template-loader')],
},
{
test: /\.(html|css)$/,
loader: 'raw-loader',
exclude: /\.async\.(html|css)$/,
},
],
},

View File

@ -6,6 +6,8 @@ import { linkTo } from '@storybook/addon-links';
import { Welcome, Button } from '@storybook/angular/demo';
import { AppComponent } from '../app/app.component';
storiesOf('Welcome')
.add('to Storybook', () => ({
component: Welcome,
@ -42,3 +44,8 @@ storiesOf('Another Button')
}
}))
storiesOf('App Component')
.add('the whole app', () => ({
component: AppComponent,
props: {}
}))