-
-
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
Can't import css #1603
Comments
Same thing after adding my custome css-loader to module.exports = {
plugins: [
// your custom plugins
],
module: {
loaders: [
// add your custom loaders.
{
test: /\.css$/,
use: [
{
loader: 'style-loader',
},
{
loader: 'css-loader',
options: {
sourceMap: true,
},
},
],
},
],
},
}; |
Try to add |
@Hypnosphi , same error. |
That's weird. Are you using webpack 2 or higher? Storybook app should use its own dependency anyway though. Which |
I am using webpack 3 |
|
Since Blueprint also imports fonts, this could by failing due to a Can you try adding file-loader or url-loader to your config?
(from webpack-contrib/css-loader#38) You can also try Otherwise there is this ongoing css-loader issue that might one day have answers - webpack-contrib/css-loader#355 |
@psimyn , thank you. But I tried to import a css file that I created only to test this, it contains only one css rule about 3 lines: body {
font-size: 40;
} and the same error persists. |
@ziedhajsalah that is odd - you get the Have you restarted storybook/webpack processes when making these changes? Do you have a repo somewhere to reproduce? |
Yes I restarted the process and also deleted the
This time is
|
change
|
Nothing is changing! |
Can you please create a GitHub repo with the same storybook setup as yours, so that we can maybe see what's not working? |
Ok, I wrapped it into create-react-app to make things simpler. |
Things start working for me if I remove the empty webpack.config.js |
@Hypnosphi the same for me!!! |
If I do this
it works for
|
Thank you for the help @Hypnosphi . It worked finally. |
this problem gets me several hours, while i remove "include: path.resolve(__dirname, "..")" ,it works. sad!!!! why ? |
@zhsisusie I think it's due to symlinking. If locally linked to the dependency, you don't need the deeper include. |
To use your CSS in all stories, you simply import it in |
I'm using version 6.3.12 and anything I've wanted to import from Node modules I've had to do in the introduction mdx... preview.js doesn't work for me... looking at all the comments this really should be simpler.... i.e. handled by Storybook Edit: .... which is obviously no good when you come to package up your library for npm |
I am trying to use storybook for the first time. In my project I am using blueprintJs as UI library so to test my components I need to import the css file for blueprint.
According to the docs
In the
.storybook/config.js
I added an import like this:Unfortunatly that does not work and I got this error:
The text was updated successfully, but these errors were encountered: