Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用webpack5并引入自定义组件重新编译时不编译 #12550

Closed
lzy1515 opened this issue Sep 22, 2022 · 3 comments
Closed

使用webpack5并引入自定义组件重新编译时不编译 #12550

lzy1515 opened this issue Sep 22, 2022 · 3 comments
Labels
F-react Framework - React T-tt Target - 编译到字节跳动小程序 V-3 Version - 3.x

Comments

@lzy1515
Copy link

lzy1515 commented Sep 22, 2022

相关平台

字节跳动小程序

复现仓库

https://gitee.com/lzy1515/test.git
小程序基础库: 2.68
使用框架: React

复现步骤

引入自定义组件后使用npm run dev:tt不编译

期望结果

编译

实际结果

不编译

环境信息

 Taro CLI 3.5.6 environment info:
    System:
      OS: Windows 10
    Binaries:
      Node: 12.22.5 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.10 - C:\Users\SKE\AppData\Roaming\npm\yarn.CMD
      npm: 8.5.2 - C:\Program Files\nodejs\npm.CMD
@taro-bot2 taro-bot2 bot added F-react Framework - React T-tt Target - 编译到字节跳动小程序 V-3 Version - 3.x labels Sep 22, 2022
@Chen-jj
Copy link
Contributor

Chen-jj commented Sep 22, 2022

@lzy1515 仓库开一下权限?

@lzy1515
Copy link
Author

lzy1515 commented Sep 22, 2022 via email

@Chen-jj
Copy link
Contributor

Chen-jj commented Oct 16, 2022

@lzy1515 你的引入写错了,要使用相对路径:

import Test from "/src/components/test/index.jsx";
// 改为:
import Test from "../../components/test/index.jsx";

或者你可以配置 webpack alias。

@Chen-jj Chen-jj closed this as completed Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-react Framework - React T-tt Target - 编译到字节跳动小程序 V-3 Version - 3.x
Projects
None yet
Development

No branches or pull requests

2 participants