Skip to content
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

Import css fail when using npm link #624

Closed
torleifhalseth opened this issue Nov 21, 2016 · 1 comment
Closed

Import css fail when using npm link #624

torleifhalseth opened this issue Nov 21, 2016 · 1 comment

Comments

@torleifhalseth
Copy link

torleifhalseth commented Nov 21, 2016

I am trying to import css from a local library using npm link. When I do this I get an error when trying to run the storybook.
Error: https://gist.github.com/thalseth/267655ff5707c896204e70b8b37eed36

I am using the default configuration that supports css imports.

My import:
import 'my-style/build/styleguide.css';

When I copy it locally everything works fine.
import './styleguide.css';

Any help is much appreciated! :)

I created a repo with example code that you can run to see the issue:
https://github.com/thalseth/css-link-import-storybook

@torleifhalseth
Copy link
Author

torleifhalseth commented Nov 24, 2016

I finally figured this out myself.
The solution was to remove the include in the custom css loader 🎆

My config now looks like this:

const path = require('path');

module.exports = {
  module: {
    loaders: [
      {
        test: /\.css$/,
        loaders: ['style', 'css?sourceMap'],
      },
    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants