Skip to content

Storybook - Support #89

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

Open
omariosouto opened this issue Jul 31, 2017 · 6 comments
Open

Storybook - Support #89

omariosouto opened this issue Jul 31, 2017 · 6 comments

Comments

@omariosouto
Copy link

Hi, how are you all?

I was creating a new setup with https://github.com/storybooks/storybook, and when I Include an stylus file the storybook can`t read the file because they need to add an extension for webpack for make everything work.

How could I implement this?

@frankstallone
Copy link

If I remember correctly, you need to do this via Storybook's Extend Mode.

@fgvicente
Copy link

You could pass an example of the webpack.config. I can not make me recognize the scss styles

@frankstallone
Copy link

I think your asking me for an example @fgvicente? If so here is my current .storybook/webpack.config.js. This works with my TypeScript, loads my static folder files appropriately and compiles my SCSS.

// load the default config generator.
const path = require('path');

module.exports = (baseConfig, env, defaultConfig) => {
  defaultConfig.resolve.extensions.push('.ts', '.tsx');

  defaultConfig.module.rules.push({
    test: /\.(ts|tsx)$/,
    loader: "ts-loader",
    options: {
      // absolute path from the current process directory if you want to use your own
      configFile: path.join(process.cwd(), './tsconfig.declaration.json')
    }
  });

  defaultConfig.module.rules.push({
    test: /\.(woff|woff2|eot|ttf|svg|gif|png)$/,
    loader: "file-loader"
  });

  defaultConfig.module.rules.push({
    test: /\.(scss|sass)$/,
    loaders: ["style-loader", "css-loader", "resolve-url-loader", "sass-loader?sourceMap"],
  });

  return defaultConfig;
};

@fgvicente
Copy link

@frankstallone thank for help but not work.
image
image
image

@frankstallone
Copy link

I don't think Storybook would even properly start if your SCSS file wasn't properly handled in webpack therefore as far as this issue is concerned it sounds like you are loading it properly now.

Your pointing to line 2 in a completely different file and I have no context as to what you are even showing in your last image. Start a new issue and breakdown your question a little further.

@omariosouto should consider closing this ticket if is indeed a solved problem.

@fgvicente
Copy link

@frankstallone I explain myself a little better. NO error storybook now, but I do not load the css. the second image shows the button without the styles and in the console it also does not show that it loads a class

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

No branches or pull requests

3 participants