#how can i tell sb where main.js is?

1 messages · Page 1 of 1 (latest)

clever smelt
#

i tried to run npx sb upgrade and got Unable to find storybook main.js config, skipping we set up our repo to potentially have multiple storybooks and our storybook config is at /dev/storybook/vue/main.js . is there a way to register where it is with storybook when running from the root directory where package.json is?

pastel whale
#

We document all CLI options here: https://storybook.js.org/docs/vue/api/cli-options

Looks like -c will do what you need.

Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and documentation. It’s open source and free.

tardy oracle
#

Where I can have a main.js example with React/Next/Typescript/Sass for 7.0.0? Mine is not working:

const babelPresetTypescript = require('@babel/preset-typescript');

module.exports = {
    stories: ['../src/**/*.stories.@(js|jsx|tsx|mdx)'],
    addons: ['@storybook/addon-essentials', '@storybook/addon-links', '@storybook/addon-actions'],
    framework: {
        name: '@storybook/nextjs',
        options: {},
    },
    babel: async (options) => {
        return {
            ...options,
            presets: [...options.presets, babelPresetTypescript],
        };
    },
    webpackFinal: async (config, { configType }) => {
        config.module.rules.push({
            test: /\.scss$/,
            use: [
                'style-loader',
                'css-loader',
                {
                    loader: 'sass-loader',
                    options: {
                        implementation: require('sass'),
                    },
                },
            ],
        });
        return config;
    },
    docs: {
        autodocs: true,
    },
};

Error is:
ERR! TypeError: [BABEL]: (0 , _helperPluginUtils.declarePreset) is not a function (While processing: /Users/phoenix/Projects/forPhoenix/node_modules/@babel/preset-env/lib/index.js)