-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storybook didn't load styles #1104
Comments
@SimonCheung1989 how do you load your CSS in the app? Is it loaded per-component or at the page-level? |
@shilman I use import '**.scss' per-component |
this is a pretty complex config. have you tried doing the bare minimum config, e.g. something like this: const path = require('path');
const config = {
module: {
loaders: [
{
test: /\.css$/,
loader: 'style!css',
include: path.resolve(__dirname, '../'),
},
{
test: /\.yml$/,
loader: 'json!yaml',
include: path.resolve(__dirname, '../data'),
},
{
test: /\.s[ac]ss$/,
loader: 'style!css!sass?includePaths[]=./node_modules',
include: path.resolve(__dirname, '../src'),
},
{
test: /\.(jpg|png|gif|eot|svg|ttf|woff|woff2)$/,
loader: 'file',
include: path.resolve(__dirname, '../'),
},
],
},
};
module.exports = config; NOTE: this is webpack1, assuming you're using a storybook 2.x version |
Finally i found i missed a plugin 'HtmlWebpackPlugin', but when i add this plugin to my custom webpack.config.js, and run storybook, it shows this error message
|
Hmm seems like you have a very complicated config. Have you thought about using |
@shilman Hi, shilman, i had found the problem, seems i can't use 'ExtractTextPlugin' when i use storybook, so i removed this plugin from my webpack config, then it's works fine, thank for your reply |
Great @SimonCheung1989 . Glad to hear you got it working! Closing this for now. |
This issue has been fixed in |
Hi, when i use
npm run storybook
and open browser with http://localhost:6006, I can see the stories that i wrote in my code, but all of the stories has no styles, i checked the page resources with F12, the page didn't load any css file, am i missed some configurations?
this is my webpack.config.js inside .storybook
this is my ../webpack/webpack.storybook.config.js
The text was updated successfully, but these errors were encountered: