eleme / morjs Goto Github PK
View Code? Open in Web Editor NEW基于小程序 DSL(微信、支付宝)的,可扩展的多端研发框架,支持一键将微信或支付宝小程序转换为微信、支付宝、百度、字节、QQ、快手、淘宝、钉钉等小程序 或 Web 应用。
Home Page: https://mor.ele.me/
License: MIT License
基于小程序 DSL(微信、支付宝)的,可扩展的多端研发框架,支持一键将微信或支付宝小程序转换为微信、支付宝、百度、字节、QQ、快手、淘宝、钉钉等小程序 或 Web 应用。
Home Page: https://mor.ele.me/
License: MIT License
执行mor init
只有以下选择
mor init
? 请选择工程类型 › - Use arrow-keys. Return to submit.
❯ 小程序
小程序插件
小程序分包
MorJS 工程插件
MorJS 运行时插件
MorJS 运行时解决方案
MorJS 多端组件库
MorJS 自定义脚手架
官方文档(https://mor.eleme.io/web/basic/quickstart
)如下,没有MorJS 标准小程序工程
可以选择,是文档没更新,还是框架对小程序转web的能力暂不支持的
npm i @morjs/cli -g # 全局安装 MorJS cli(如已安装可跳过)
mor init # 选择 MorJS 标准小程序工程,然后填写信息,在填写 投放渠道 这一项时将 Web 选中
npm run dev:web # 运行项目,控制台会打印地址和二维码
环境:
morjs:master 分支
操作系统windows11
nvm
node: 16.14.0
pnpm: 7.33.6
报错如下:
构建失败!错误信息如下👇🏻
错误信息: Command failed with exit code 2: tsc
src/runtime/public/component.tsx(467,17): error TS2339: Property 'props' does not exist on type 'ReactNode'.
Property 'props' does not exist on type 'string'.
src/runtime/public/component.tsx(467,28): error TS2339: Property 'props' does not exist on type 'ReactNode'.
Property 'props' does not exist on type 'string'.
src/runtime/public/component.tsx(468,22): error TS2339: Property 'props' does not exist on type 'ReactNode'.
Property 'props' does not exist on type 'string'.
错误堆栈: Error: Command failed with exit code 2: tsc
src/runtime/public/component.tsx(467,17): error TS2339: Property 'props' does not exist on type 'ReactNode'.
Property 'props' does not exist on type 'string'.
src/runtime/public/component.tsx(467,28): error TS2339: Property 'props' does not exist on type 'ReactNode'.
Property 'props' does not exist on type 'string'.
src/runtime/public/component.tsx(468,22): error TS2339: Property 'props' does not exist on type 'ReactNode'.
Property 'props' does not exist on type 'string'.
at makeError (C:\code\mini\morjs\node_modules.pnpm\[email protected]\node_modules\execa\lib\error.js:60:11)
at handlePromise (C:\code\mini\morjs\node_modules.pnpm\[email protected]\node_modules\execa\index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async build (C:\code\mini\morjs\scripts\build.js:72:5)
at async Promise.all (index 1)
at async buildAll (C:\code\mini\morjs\scripts\build.js:113:5)
ELIFECYCLE Command failed with exit code 1.
日历组件地址 :https://github.com/treadpit/wx_calendar 。组件实际内容见附件
v2.zip
引用页面: "usingComponents": {
"calendar": "../../component/v2/index"
}
实际渲染出来的是
并不是实际日历绘制出的内容。
vant 路径解析错误
src/pages/index/index.json
{
"usingComponents": {
"van-popup": "@vant/weapp/popup/index",
"wxml-to-canvas": "wxml-to-canvas",
"van-field": "@vant/weapp/field/index",
"select": "../../components/select/index"
}
}
mor.config.ts
import { defineConfig } from '@morjs/cli';
import path from 'path';
export default defineConfig(
[
{
name: 'wechat',
sourceType: 'wechat',
target: 'web',
},
// {
// name: 'wechat',
// sourceType: 'wechat',
// target: 'wechat',
// },
].map(cfg => {
return {
...cfg,
alias: {
'@vant/weapp/': path.join(
__dirname,
'./src/miniprogram_npm/@vant/weapp/',
),
},
};
}),
);
执行命令
mor compile -w
error :
Can't resolve '@vant/weapp/popup/index' in '/Users/u/Desktop/project/src/pages/index'
[mor] ✖ ⁃ finishWithoutResolve
node_modules/.pnpm/[email protected]/node_modules/enhanced-resolve/lib/Resolver.js:309
Describe the bug
ctx = MOR_API.createCanvasContext(this.data.canvasId, this)ctx为undefined
To Reproduce
代码地址:https://github.com/brainee/weixin-pages-morjs/tree/main
直接运行npm run dev
Expected behavior
echart能运行
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
When I initialize the project according to the examples on the official website, I get an error when running dev.
Steps to reproduce the behavior:
[mor] ✖ Cannot read properties of undefined (reading 'entryName')
[mor] ✖ ⁃ anonymous
node_modules\.pnpm\@[email protected]_@[email protected][email protected][email protected]\node_modules\@morjs\plugin-compiler-web\lib\plugins\generateJSXEntryPlugin.js:292
⁃ GenerateJSXEntryPlugin.generateEntryFiles
node_modules\.pnpm\@[email protected]_@[email protected][email protected][email protected]\node_modules\@morjs\plugin-compiler-web\lib\plugins\generateJSXEntryPlugin.js:290
⁃ anonymous
node_modules\.pnpm\@[email protected]_@[email protected][email protected][email protected]\node_modules\@morjs\plugin-compiler-web\lib\plugins\generateJSXEntryPlugin.js:142
问题描述
autoInjectRuntime.api配置为true,组件代码内有“wx”字符串时,转译成web端报错
环境信息
src目录增加其他目录代码, assets目录增加非图片资源(.svga | .wasm | .gif), 编译之后, 小程序没有这些文件了, 应该怎么配置呢
Describe the bug
Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can set throwIfNamespace: false
to bypass this warning.
<tiga-input class={"new-todo"} model:value={$rm.toJsonString(todoTitle, false)} placeholder={"What needs to be done?"} autofocus />
To Reproduce
如上描述
Expected behavior
可支持,因为微信官方支持:https://developers.weixin.qq.com/miniprogram/dev/framework/view/two-way-bindings.html
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
1、processNodeModules设为true
import { defineConfig } from '@morjs/cli'
export default defineConfig([
{
name: 'web',
sourceType: 'wechat',
target: 'web',
compileType: 'miniprogram',
processNodeModules: true,
compileMode: 'bundle',
cache: false
}
])
2、执行npm run dev:web,编译没问题,打开页面报:
Cannot read properties of undefined (reading 'ALIPAY')
3、关闭processNodeModules则恢复正常
Describe the bug
Click event not responding after converting a miniprogram from Wechat type to Alipay type.
To Reproduce
Steps to reproduce the behavior:
1、Download the demo and install dependencies.
2、Run script npm run dev
to convert the miniprogram to an alipay type.
3、Open converted project folder with Alipay IDE.
4、Click the button "返回" at the upper left corner.
Expected behavior
It show toast "点击返回"
Screenshots
None
Alipay IDE
BUG描述
拉取项目后,按着 贡献指南的操作 时,遇到了一些问题;
环境信息
node_version => v18.16.0
pnpm => 8.2.0
OS => windows 11
问题
在执行pnpm build
遇到了下面两个问题
packages/core
和packages/runtime-mini
的tslib
版本过低导致打包失败// 报错信息
error TS2343: This syntax requires an imported helper named '__spreadArray' which does not exist in 'tslib'. Consider upgrading your version of 'tslib'.
// 解决方式
将tslib升级到了最新的2.5.0版本解决了该问题
packages/runtime-web
报错props
不存在ReactNode
的类型上不太熟悉
react
,所以选择最直接的方法,直接注释了相应的代码😂
// 报错信息
src/runtime/public/component.tsx(462,18): error TS2339: Property 'props' does not exist on type 'ReactNode'.
Property 'props' does not exist on type 'string'.
使用eslint --print-config ./.eslintrc
检测eslint配置文件 发生报错 是规则冲突了
本地去除规则"prettier/@typescript-eslint"
eslint就能正常运行
Describe the bug
源项目是 微信,再编译后转 es5 Set的解构有问题
以及 array的entries() 迭代器转换问题
To Reproduce
Steps to reproduce the behavior:
let a = [1,2,3]
a = [...new Set(a)]
console.log(a, 'a')
// [] a为空数组
for (const [index, ele] of a.entries()) {
console.log(index, ele)
// 不触发 console
}
Expected behavior
预期期望出现 [1,2,3]
迭代器出现
0,1
1,2
2,3
myapp.zip
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
问题描述
wComponent 转支付宝后,组件接受 a, b 两个 properties 而且都有 observer,转到支付宝之后,父组件改变 a 的值的情况下,b 的 observer 也会执行。预期:应该只执行 a 的 observer
环境信息
@morjs/cli => 1.0.27
@morjs/core => 1.0.11
node_version => v16.15.1
yarn => 1.22.19
OS => MAC OS 12.4
Describe the bug
页面转换后,报
[mor] ✖ 绑定表达式: { class } 不符合 JS 表达式规范
无具体日志和说明
To Reproduce
https://github.com/brainee/weixin-pages-morjs/tree/main
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
npm安装了antd-mini,在页面中引入 "tag": "antd-mini/es/Tag/index",会提示VM106:3 error[Build]: unknown
/../../node_modules/antd-mini/es/Tag/index 未注册,却被 /pages/calendarProduct/calendarProduct 作为自定义组件引用
https://github.com/DiamondYuan/ant-design-mini-reproduce/tree/main/mor-vant-tabs
复现 demo: https://github.com/DiamondYuan/ant-design-mini-reproduce/tree/main/behavior
Describe the bug
支付宝组件指定默认抽象节点配置并且同时在多个原生分包引入时出现报错及生命周期无法执行。报错内容 “Component() 构造器被调用多次”。
To Reproduce
Steps to reproduce the behavior:
Expected behavior
无报错及 user-name 组件的生命周期可以正常执行
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
[
{
name: 'wechat-subpackage',
sourceType: 'wechat',
target: 'wechat',
compileType: 'subpackage',
compileMode: 'bundle',
autoClean:true,
jsMinimizer: 'esbuild',
},
{
name: 'alipay-subpackage',
sourceType: 'wechat',
target: 'alipay',
compileType: 'subpackage',
compileMode: 'bundle',
autoClean:true,
jsMinimizer: 'esbuild',
},
]
Describe the bug
A clear and concise description of what the bug is.
$ pnpm run dev
[email protected] dev /Users/xxx/mini-program/mor-app
mor compile --watch
[mor] ℹ 发现配置文件: mor.config.ts
[mor] ✔ 配置文件加载成功: mor.config.ts
[mor] ℹ 准备配置中, 即将开始编译 👇
配置名称: wechat-miniprogram
编译目标: 微信小程序
编译环境: development
编译类型: 小程序
编译模式: bundle
源码类型: wechat
源码目录: src
输出目录: dist/wechat
[mor] ℹ 已开启缓存, 可通过 --no-cache 关闭
[mor] ℹ 启动文件监听模式
[mor] ℹ 开始编译 ...
[mor] ℹ 依赖分析中 ...
[mor] ℹ 依赖分析完成: 耗时: 87.816729 ms
[mor] ✔ 编译完成, 耗时: 624.34235 ms
[mor] ℹ 准备配置中, 即将开始编译 👇
配置名称: alipay-miniprogram
编译目标: 支付宝小程序
编译环境: development
编译类型: 小程序
编译模式: bundle
源码类型: wechat
源码目录: src
输出目录: dist/alipay
[mor] ℹ 已开启缓存, 可通过 --no-cache 关闭
[mor] ℹ 启动文件监听模式
[mor] ℹ 开始编译 ...
[mor] ℹ 依赖分析中 ...
[mor] ℹ 依赖分析完成: 耗时: 100.650343 ms
[mor] ✔ 编译完成, 耗时: 289.723189 ms
[mor] ℹ 准备配置中, 即将开始编译 👇
配置名称: web
编译目标: Web 应用
编译环境: development
编译类型: 小程序
编译模式: bundle
源码类型: wechat
源码目录: src
输出目录: dist/web
[mor] ℹ 已开启缓存, 可通过 --no-cache 关闭
[mor] ℹ 启动文件监听模式
[mor] ℹ 开始编译 ...
[mor] ℹ 依赖分析中 ...
[mor] ℹ 依赖分析完成: 耗时: 95.986822 ms
[mor] ⠴ 正在编译, 进度: 92.44%
[mor] ℹ 浏览器中打开链接: http://192.168.0.32:8080
或通过手机扫描下方二维码预览 👇
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
[mor] ✔ 编译完成, 耗时: 1409.475179 ms
[mor] ✖ 编译 ./mor-entries/pages/index/index.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/classCallCheck' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/index'
[mor] ✖ 编译 ./mor-entries/pages/index/index.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/createClass' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/index'
[mor] ✖ 编译 ./mor-entries/pages/index/index.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/possibleConstructorReturn' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/index'
[mor] ✖ 编译 ./mor-entries/pages/index/index.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/isNativeReflectConstruct' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/index'
[mor] ✖ 编译 ./mor-entries/pages/index/index.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/getPrototypeOf' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/index'
[mor] ✖ 编译 ./mor-entries/pages/index/index.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/inherits' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/index'
[mor] ✖ 编译 ./mor-entries/pages/logs/logs.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/classCallCheck' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/logs'
[mor] ✖ 编译 ./mor-entries/pages/logs/logs.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/createClass' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/logs'
[mor] ✖ 编译 ./mor-entries/pages/logs/logs.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/possibleConstructorReturn' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/logs'
[mor] ✖ 编译 ./mor-entries/pages/logs/logs.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/isNativeReflectConstruct' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/logs'
[mor] ✖ 编译 ./mor-entries/pages/logs/logs.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/getPrototypeOf' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/logs'
[mor] ✖ 编译 ./mor-entries/pages/logs/logs.jsx 失败:
=> Module not found: Error: Can't resolve '@babel/runtime/helpers/inherits' in '/Users/xxx/mini-program/mor-app/mor-app/src/mor-entries/pages/logs'
To Reproduce
Steps to reproduce the behavior:
使用微信DSL开发转web时,observers的触发早于组件的生命周期created.
由于一些逻辑和方法会封装在组件created事件内(例如tdesign就是),但转换到web时,observers内的事件触发早于组件的created触发。
原本的代码中调用的是wx.request
方法,但是编译为qq小程序时发现没有请求发出去,调试后发现这段中的函数没有调用
我当前的解决方案是把这段代码
改为了
if (actualApiName === 'request') return getOriginalRequest(global) (obj)
我不知道这算不算具体的问题所在,不过还是麻烦你们看下
Describe the bug
MOCK_RUNTIME_FILE路径错误,导致无法构建。应该是**/**
D:\work\zuJianKu\mor-components>pnpm run dev
[email protected] dev D:\work\zuJianKu\mor-components
mor compile --watch --mock
D:\work\zuJianKu\mor-components\node_modules.pnpm@[email protected]\node_modules@morjs\plugin-mocker\lib\runtimes\mock.js >>>>>>>>>>>>>>>>>XXXX
[mor] i 发现配置文件: mor.config.ts
[mor] √ 配置文件加载成功: mor.config.ts
[mor] ‼ 已开启 mock 功能
[mor] i 准备配置中, 即将开始编译 👇
配置名称: ali
编译目标: 支付宝小程序
编译环境: development
编译类型: 小程序
编译模式: bundle
源码类型: wechat
源码目录: src
输出目录: dist\alipay
[mor] i 已开启缓存, 可通过 --no-cache 关闭
[mor] i 启动文件监听模式
[mor] i 开始编译 ...
[mor] i 依赖分析中 ...
[mor] i 依赖分析完成: 耗时: 190.8397 ms
[mor] √ 编译完成, 耗时: 2839.0836 ms
[mor] × 编译 D:workzuJianKumor-components
ode_modules.pnpm@[email protected]
untimesmock.js 失败:morjsplugin-mockerlib
=> Module build failed: UnhandledSchemeError: Reading from "D:workzuJianKumor-components
ode_modules.pnpm@[email protected]
untimesmock.js" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "d:" URIs.
at D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]_ob4k3dxoir7qyq3qpk7cszlhlq\node_modules\webpack\lib\NormalModule.js:834:25
at Hook.eval [as callAsync] (eval at create (D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]\node_modules\tapable\lib\HookCodeFactory.js:33:10), :6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]\node_modules\tapable\lib\Hook.js:18:14)
at Object.processResource (D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]_ob4k3dxoir7qyq3qpk7cszlhlq\node_modules\webpack\lib\NormalModule.js:831:8)
at processResource (D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]\node_modules\loader-runner\lib\LoaderRunner.js:220:11)
at iteratePitchingLoaders (D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]\node_modules\loader-runner\lib\LoaderRunner.js:171:10)
at runLoaders (D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]\node_modules\loader-runner\lib\LoaderRunner.js:398:2)
at NormalModule._doBuild (D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]_ob4k3dxoir7qyq3qpk7cszlhlq\node_modules\webpack\lib\NormalModule.js:821:3)
at NormalModule.build (D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]_ob4k3dxoir7qyq3qpk7cszlhlq\node_modules\webpack\lib\NormalModule.js:965:15)
at D:\work\zuJianKu\mor-components\node_modules.pnpm\[email protected]_ob4k3dxoir7qyq3qpk7cszlhlq\node_modules\webpack\lib\Compilation.js:1371:12
To Reproduce
1.pnpm run dev
ps:"dev": "mor compile --watch --mock",
Expected behavior
能在window系统构建mock
solution
将MOCK_RUNTIME_FILE进行转斜杆.用.replace(/\/g, '/')
const initMockFileContent = [
import Mock from '${MOCK_RUNTIME_FILE}.replace(/\\/g, '/')';
,
adapterImports.join(';\n'),
var mockContext = require.context(${JSON.stringify(path_1.default.resolve(cwd, mockOptions.path))}, true, /\\.(cjs|js|json|json5|jsonc|mjs|ts)$/)
,
// 传入的 adapters 是 new 后的对象实例组,可运行 run 方法获取返回结果
var adapters = [${adapterItems.join(', ')}]
,
var mock = new Mock(mockContext, '${JSON.stringify(mockOptions)}', '${globalObject}', adapters);
,
mock.run();
].join('\n');
// 写入内存文件
this.wrapper.fs.mem.mkdirpSync(path_1.default.dirname(mockFilePath));
this.wrapper.fs.mem.writeFileSync(mockFilePath, initMockFileContent);
return mockFilePath;
微信原生项目转头条小程序,框架报错,业务项目中并没有使用 nextTick api
difineConfig配置
{
name: 'toutiao-miniprogram',
sourceType: 'wechat',
target: 'bytedance',
compileType: 'subpackage',
compileMode: 'bundle',
outputPath: 'dist/dev/mp-toutiao-pack/familyReserve/',
alias: {
'@': ''
},
autoClean: true,
processNodeModules: { include: [Array] },
webpackChain: [Function: webpackChain],
conditionalCompile: { context: [Object] }
}
]
Describe the bug
在使用vantui库时候,如果主包引用了 一个 vant-a组件,子包引用vant-b组件(需要是notice这类wxs还依赖公共wxs的组件),这个时候进行 build,产物中,子包的npm_package 中 vant缺少公共的wxs文件导致 函数不存在。
To Reproduce
初始化项目,添加 @vant/weapp
在主页面 pages/index 下引入 vant-icon
在子包页面中 src/subPackages/subPackage1/demo 中添加 van-notice-bar组件
然后执行 compile
子包的npm_components下 vant的 van-notice-bar 组件缺少公共的 wxs引入
Expected behavior
将公用的 wxs引入到子包的 npm_components中 或者 针对van这类ui组件同一放在 主包的 npm_components中
Screenshots
If applicable, add screenshots to help explain your problem.
代码示例
myapp.zip
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Module not found: Error: Can't resolve './pages/index/index' in 'PROJECT-DIR/src/mor-entries'
错误代码:node_modules@morjs\plugin-compiler-web\lib\plugins\emitIntermediateAssetsPlugin.js
await utils_1.fsExtra.outputFile(path_1.default.join(intermediateAssetsDir, path_1.default.resolve('/', filePath)), source);
信息如何下:
[mor] ℹ 准备配置中, 即将开始编译 👇
配置名称: web
编译目标: Web 应用
编译环境: development
编译类型: 小程序
编译模式: bundle
源码类型: wechat
源码目录: src
输出目录: dist\web
[mor] ℹ 已开启缓存, 可通过 --no-cache 关闭
[mor] ℹ 已开启 web 转端中间产物输出: .mor\compiler\intermediate-assets\web
[mor] ℹ 开始编译 ...
[mor] ℹ 依赖分析中 ...
[mor] ℹ 依赖分析完成: 耗时: 417.9389 ms
[mor] ⠏ 正在编译, 进度: 10.00%
Debugger ending on ws://127.0.0.1:5858/1802ce6f-c74e-440d-9695-ef1a8c918f7b
[mor] ✔ 编译完成, 耗时: 2377504.3526 ms
[mor] ✖ 编译 ./mor-entries/app.jsx 失败:
=> Module build failed (from ../node_modules/@morjs/plugin-compiler/lib/loaders/postprocessLoader.js):
Error: Path contains invalid characters: C:\Work\MusicLabs\morjs\examples\wechat.mor\compiler\intermediate-assets\web\C:\src\mor-entries
at checkPath (C:\Work\MusicLabs\morjs\examples\wechat\node_modules\fs-extra\lib\mkdirs\utils.js:16:21)
at module.exports.makeDir (C:\Work\MusicLabs\morjs\examples\wechat\node_modules\fs-extra\lib\mkdirs\make-dir.js:12:3)
at Object. (C:\Work\MusicLabs\morjs\examples\wechat\node_modules\universalify\index.js:21:10)
at C:\Work\MusicLabs\morjs\examples\wechat\node_modules\fs-extra\lib\output-file\index.js:20:11
at C:\Work\MusicLabs\morjs\examples\wechat\node_modules\universalify\index.js:21:38
[mor] ✖ 编译错误, 请检查相关报错信息
我想通过配置添加Uno CSS的功能,请问怎么实现?
import { defineConfig } from '@morjs/cli'
export default defineConfig([
// {
// name: 'wechat-miniprogram',
// sourceType: 'wechat',
// target: 'wechat',
// compileType: 'miniprogram',
// compileMode: 'bundle'
// },
{
name: 'web',
sourceType: 'wechat',
target: 'web',
compileType: 'miniprogram',
compileMode: 'bundle',
processNodeModules: {
include: [/tdesign\-miniprogram/]
}
}
])
引入的是tdesign-miniprogram属于是小程序组件是不是因为他本身就没有多端转换的能力,又想用这个ui组件库该怎么办呢
微信转支付宝时,地图API存在问题:
地图的polygons属性帮忙看看是不是转化有问题,微信polygons转化之后还是polygons,支付宝官方是polygon,而不是polygons
rt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.