lowcode-engine
lowcode-engine copied to clipboard
新开发组件时,包名中组织名带中划线(如:@fe-test/material),启动后报错
Describe the bug (required) / 详细描述 bug(必填)
npm init @alilc/element your-material-name
开发组件库时,包名中的组织名带中划线,通过npm run lowcode:dev
启动后报错
To Reproduce (required) / 如何复现 bug?(必填,非常重要)
- npm init @alilc/element your-material-name
- 包名设置为@fe-test/material
- npm i && npm run lowcode:dev 启动
- 报错截图
Expected behavior (required) / 预期行为(必填,非常重要)
正常启动
Environments (please complete the following information) (required): / 请提供如下信息(必填)
- AliLowCodeEngine version: [e.g. 1.0.6] / 低代码引擎版本
- AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本
- Browser [e.g. chrome, safari] / 浏览器版本
- materials / plugins / tools / 其他物料 / 插件 / 工具链版本
这个其实是windows路径找不到已 / 描述的路径,改为 \就好。在修改 node_modules/alifd/build-plugin-lowcode/index.js:291附近,修改
metaPathMap[item.slice(item.lastIndexOf('\\') + 1, item.lastIndexOf('.'))] = item;
可以正确查找到 meta.js文件。
metaPathMap[item.slice(item.lastIndexOf('\') + 1, item.lastIndexOf('.'))] = item;
不行诶,改了之后重新启动还是报上名的错误。我是在mac环境下的,不是windows。
如果是@fe-test/material。最后挂载的时候是window.fe-testMaterial,所以报错的 其实还有个更方便的方法,改个名字,你把名称里面的-去掉就好啦 如@fetest/material ~。
@alifd/build-plugin-lowcode/utils/index.js:29 parseNpmName 方法能否兼容一下
https://github.com/alibaba/lowcode-tools/blob/main/packages/build-plugin-lowcode/README.md
@alifd/build-plugin-lowcode 开源了,有没有哪位大佬来兼容下 windows 环境呀