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

Add json loader #261

Closed
wants to merge 1 commit into from
Closed

Add json loader #261

wants to merge 1 commit into from

Conversation

roonyh
Copy link
Contributor

@roonyh roonyh commented Jun 21, 2016

Adding json-loader to default storybook loaders. This is a fix for storybook-eol/react-storybook-addon-info#12.

@danielkcz
Copy link
Contributor

danielkcz commented Jun 21, 2016

I see a tiny problem here. In my webpack config I already have json loader defined to load JSON files within my application.

{ test: /\.json$/, loader: 'json', include: srcPath },

In storybook/webpack.config.js I have it like this.

var pathUtils = require('path');
var merge = require('webpack-merge');
var validate = require('webpack-validator');
var baseConfig = require('../webpack.config.js');

module.exports = function(storybookConfig) {
    var config = merge.smart(storybookConfig, {
        devtool: 'source-map',
        module: baseConfig.module,
        resolve: baseConfig.resolve,
    });
    return validate(config);
};

That means the json loader will be merged together and include path will be preserved there causing that addon requirement wont be fulfilled anyway.

@arunoda
Copy link
Member

arunoda commented Jun 21, 2016

We fix this with a much better way. See: storybook-eol/react-storybook-addon-info#12

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

Successfully merging this pull request may close these issues.

4 participants