yarn add:component button 生成的模板没有替换组件名
seepine opened this issue · 5 comments
seepine commented
seepine commented
os:win10
node:16.13.1
npm:8.1.2
有条件的话win10下测一下吧
bqzhaoyan commented
我这边没有 windows 环境,方便的话可以排查一下可以给这个仓库提个 PR。添加组件的脚本位于项目的
scripts/add-component.js
。
请问解决了吗
bqzhaoyan commented
babel.config.js把这行注释一下
在 2023-01-18 17:18:22,"Rider" ***@***.***> 写道:
KPI 项目是真的辣鸡, 代码都跑不起来!
windows环境下把 scripts/add-components.js 中的代码替换成如下就可以替换模板了
//oldconstcomponentName=process.argv[2];consttemplatePath=path.resolve(__dirname,"template");consttargetComponentPath=path.resolve(__dirname,`../components/${componentName}`);consttargetStoryPath=path.resolve(__dirname,`../stories`);//newconstcomponentName=process.argv[2];consttemplatePath=path.resolve(__dirname,"template").replace(/\\/g,"/");consttargetComponentPath=path.resolve(__dirname,`../components/${componentName}`).replace(/\\/g,"/");consttargetStoryPath=path.resolve(__dirname,`../stories`).replace(/\\/g,"/");
然而还是运行不起来,dev 运行还是报下面的错
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>