-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Description
1.7.X 版本是可以引用并正常打包通过 npm 引入的 wpy 组件的。
2.0 可以通过 npm 引入原生组件、但引入 wpy 组件却不能正常打包(具体现象是不能在输出目录中创建 $vendor
目录)。
示例代码如下:
/*
@wepy/cli: 2.0.0-alpha.25
@wepy/core: 2.0.0-alpha.14
*/
<config>
{
usingComponents: {
// 原生组件,即导出的是 js+json+wxml+wxss 可以正常打包;文档中给出的示例里的 miniprogram-slide-view 就是原生组件
'com1': 'module:my-weapp-component',
// wepy2 组件,即导出的是 wpy 文件,无法打包
'com2': 'module:my-wepy2-component'
}
}
</config>
目前发现只需要改动 @wepy/cli/core/plugins/parser/wpy.js
中的第 25 行:
let context = {
file,
type,
npm: type === 'module'
component: true
};
修改为:
let context = {
file,
type,
npm: type === 'module' || comp.npm // 此处
component: true
};
即可正常打包 wpy 组件,还未发现有其他副作用。
麻烦确认是否是 Bug。
Metadata
Metadata
Assignees
Labels
No labels