gpt4 book ai didi

storybook - framer-motion 在构建环境中出现故事书错误

转载 作者:行者123 更新时间:2023-12-05 09:27:16 25 4
gpt4 key购买 nike

我正在构建一个 UI 库。

有没有人用 framer-motion 和 storybook?

在storybook中运行正常,但是在构建环境中出现错误。

有些人建议降级,但它对我不起作用。

有没有人遇到和我一样的问题?

最佳答案

在这里遇到同样的问题。我认为这是由于新版本的 Framer-motion 与某些工具不兼容。我今天会调试并让您知道我是否能够找到解决方案。

编辑

成功了!将以下内容添加到您的 .storybook/main.js 文件中

module.exports = {
// Any existing rules
...

// The fix
webpackFinal: async (config) => {
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto",
});
return config;
}
}

关于storybook - framer-motion 在构建环境中出现故事书错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72710138/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com