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

Including custom CSS in beta #317

Closed
oertels opened this issue Feb 10, 2017 · 5 comments
Closed

Including custom CSS in beta #317

oertels opened this issue Feb 10, 2017 · 5 comments
Labels

Comments

@oertels
Copy link

oertels commented Feb 10, 2017

Hi,

I'm, using styleguidist 5beta, and I'm having problems including my custom sass file.

styleguide.config.js:

const path = require('path');

module.exports = {
    title: 'My Style Guide',
    serverPort: 3001,
    skipComponentsWithoutExample: true,
    webpackConfigFile: path.resolve(__dirname, './webpack.styleguidist.js'),  // eslint-disable-line
    components: path.resolve(__dirname, 'src/**/*.jsx')  // eslint-disable-line
};

webpack.styleguidist.js:

var path = require('path');
var webpack_config = require('./webpack.config');

var WebpackStyleguidist = Object.assign({}, webpack_config);
WebpackStyleguidist.entry.push(path.join(__dirname, 'src', 'sass', 'styles.scss'));  // eslint-disable-line
WebpackStyleguidist.entry.unshift('babel-polyfill');

module.exports = WebpackStyleguidist;

Webpack version: 1.13.1
macOS, Chrome 56.

The sass file exists (I dumped the path), and the application finds it, only staleguidist doesn't.
Any idea?

@sapegin
Copy link
Member

sapegin commented Feb 10, 2017

Would you mind making an example as described here.

@sapegin
Copy link
Member

sapegin commented Feb 10, 2017

I see. entry will be ignored for webpackConfigFile as described in the docs. Use webpackConfig for that.

https://github.com/styleguidist/react-styleguidist/blob/master/docs/Cookbook.md#how-to-add-custom-javascript-and-css-or-polyfills

@oertels
Copy link
Author

oertels commented Feb 10, 2017

Great, that solved the problem. I don't find this in the docs, however. Maybe it would be a good idea to add this particular issue in the paragraph you mentioned.

Anyway, thanks for this great tool and your support!

@sapegin
Copy link
Member

sapegin commented Feb 10, 2017

I’ve added a whole new page about webpack: https://github.com/styleguidist/react-styleguidist/blob/next/docs/Webpack.md

(Make sure you browse docs in the next branch.)

@oertels
Copy link
Author

oertels commented Feb 10, 2017

Ah I see - sorry for the fuzz and thanks again.

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

No branches or pull requests

2 participants