Skip to content

2.0.0-rc4

Pre-release
Pre-release
Compare
Choose a tag to compare
@sapegin sapegin released this 17 Feb 10:28
· 1882 commits to master since this release

Breaking changes

Now you need to explicitly specify all Webpack loaders for your project’s code in styleguide.config.js:

module.exports = {
    // ...
    updateWebpackConfig: function(webpackConfig, env) {
        var sourceDir = path.resolve(__dirname, 'src');
        webpackConfig.module.loaders.push(
            // Babel (will use your project’s .babelrc)
            {
                test: /\.jsx?$/,
                include: sourceDir,
                loader: 'babel'
            },
            // Sass
            {
                test: /\.scss$/,
                include: sourceDir,
                loader: 'style!css!sass?precision=10'
            }
        );
        return webpackConfig;
    }
};

Your project’s .babelrc will not affect Styleguidist, only the loaders you define in styleguide.config.js.

When you run dev-server NODE_ENV is set to development so if you use React Transform hot module replacement it will be enabled your components. Otherwise you need to set it up manually. When you build style guide NODE_ENV is set to production.

This is a big change so I’m looking forward for your feedback.

Other changes

  • Remove postcss to reduce possible conflicts with project’s code: postcss-loader would share plugins.
  • Fallback to file name or folder name if component name can’t be detected in runtime (#84).