styleguidist server运行完美(非常感谢)
我现在想构建静态html文件,以便在github页面中使用,但是..
styleguidist build抛出了插件,它似乎起源于TypeError: Cannot read property 'tapAsync' of undefined -- webpack --这个插件只在我的作品“webpack”配置中使用。
似乎styleguidist build将-p标志传递给了webpack (或者以其他方式导致使用此配置),但我更喜欢使用开发配置进行构建。
有人知道这是如何实现的吗?
发布于 2019-03-11 00:26:01
不知道你是否仍然有这个问题,但是我刚刚遇到了用Create React App和Typescript....had创建一个新的Styleguidist项目的问题,开发服务器工作得很好,但是create-react-app的生产构建设置中的一些东西导致了与styleguidist自己的内部东西的冲突。
在styleguide.config.js中,附加在我的设置对象中
module.exports = {
// ...other configgy stuff,
webpackConfig: require('./node_modules/react-scripts/config/webpack.config.js')(
'development'
),
};不确定这是否是100%正确的,但适用于我的情况。根据styleguidist的文档,为create-react-app设置的一些东西可能会破坏这个过程
https://react-styleguidist.js.org/docs/webpack.html#reusing-your-projects-webpack-config
我猜你也可以这样做..我是在黑了这个修复https://react-styleguidist.js.org/docs/cookbook#how-to-use-production-or-development-build-of-react后发现的
{
"scripts": {
"build": "cross-env NODE_ENV=development react-styleguidist build"
}
}我还没试过yet...guess,我应该先用RTFM的
https://stackoverflow.com/questions/50985014
复制相似问题