web
web copied to clipboard
[dev-server-storybook] build crashes, asks for a babel plugin
Hi
I've got this error when doing a build-storybook (wds works perfectly when serving locally though):
Add @babel/plugin-syntax-import-assertions (https://git.io/JUbkv) to the 'plugins' section of your Babel config to enable parsing.
I'm not sure how to fix it since I think I only have control over Rollup plugins, as explained here https://modern-web.dev/docs/dev-server/plugins/storybook/#customizing-the-build
I've tried this without success on .storybook/main.js:
const { babel } = require('@rollup/plugin-babel');
module.exports = {
rollupConfig(config) {
config.plugins.push(babel({
plugins: [
[require.resolve('@babel/plugin-syntax-import-assertions')]
]
}));
return config;
},
};
Any help or hint about how to proceed?
Maybe @LarsDenBakker :)