Open Tomoyd opened 1 year ago
@Tomoyd 麻烦提供一下 demo
遇到同样问题,请问解决了吗
+1
+1
+1 脚手架创建的jsx项目出现同样的问题。。。
+1 脚手架创建的jsx项目出现同样的问题。。。, 使用 TS webpack5 react 默认模板 配置打开了 prebundle: { enable: false, }, cache: { enable: true, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache },
这个我能复现,暂时没时间调试,晚点我找时间搞个demo
+10086
这个问题 请问有后续不~
相关平台
微信小程序
小程序基础库: 2.27.3 使用框架: Vue 3
复现步骤
yarn dev:weapp 多端文件解析报错
多端文件如下:
assets/js/gio/config.alipay.js
assets/js/gio/config.tt.js
assets/js/gio/config.weapp.js
assets/js/gio/index.alipay.js
assets/js/gio/index.tt.js
assets/js/gio/index.weapp.js
业务代码
const gioConfig = require("./assets/js/gio/config").default
const gio = require("./assets/js/gio/index").default
gio("setConfig", gioConfig)
用Taro 3.5.7 init 出来的项目,也会报错
如果过改成
const gioConfig = require("./assets/js/gio/config.weapp").default
let gio = require("./assets/js/gio/index.weapp").default
gio("setConfig", gioConfig)
是正常的
多端文件加载有问题
不关闭prebundle 多端文件解析存在问题
期望结果
编译成功
实际结果
[ERROR] [plugin scanImports] Can't resolve './assets/js/gio/index' in 'D:\frontend\local\myApp\src'
This error came from the "onResolve" callback registered here:
The plugin "scanImports" was triggered by this import
Prebundle dependencies: @tarojs/plugin-framework-vue3/dist/runtime @tarojs/plugin-platform-weapp/dist/runtime @tarojs/runtime @tarojs/taro vue
✔ Webpack Compiled successfully in 3.99s
→ Watching... [2023/2/10 15:25:23]
环境信息