当我编写故事书时,它可以在本地计算机上工作。
但是,当我尝试制作build-storybook时,它完成了构建,但是在所有story.js中抛出警告,甚至没有运行Storybook。 (附照片)
这对我没有帮助。
https://github.com/storybookjs/storybook/issues/1493
main.js
module.exports = {
presets: [
[
'@babel/preset-env',
{
modules: false,
},
],
'@babel/preset-react',
],
plugins: [
'styled-components',
[
"@babel/plugin-proposal-class-properties",
{
loose: true, // Need this for Storybook v6 beta.
}
],
'@babel/plugin-syntax-dynamic-import',
],
env: {
production: {
only: ['app'],
plugins: [
'lodash',
'transform-react-remove-prop-types',
'@babel/plugin-transform-react-inline-elements',
'@babel/plugin-transform-react-constant-elements',
[
"@babel/plugin-proposal-class-properties",
{
loose: true, // Need this for Storybook v6 beta.
}
],
],
},
test: {
plugins: [
'@babel/plugin-transform-modules-commonjs',
'dynamic-import-node',
],
},
},
};
babel.config.js
{{1}}
web.config文件已完全复制:https://github.com/storybookjs/storybook/issues/1493#issuecomment-326976624
在控制台(已部署的构建服务器)中: react-dom.development.js:2084 Uncaught TypeError:无法读取未定义的属性'fonts' 在供应商处〜main.d24d5cad21c9738766d4.bundle.js:2