H5编译的时候:Cannot find module "fs"。
Author: haoranyaCreated Jun 28, 2021Updated Jul 8, 2021
Labelsbug
bug描述 项目初始化后,引入使用node的require('fs')模块会直接报错,找不到fs 复现bug的步骤
- cml init project
- cd test
- cml dev
- index.cml 的script中添加:const fs = require('fs')
问题截图

编译环境信息
- chameleon-tool 版本:1.0.8
- nodejs版本 npm版本:[node v10.13.0、npm 6.4.1]
- 电脑操作系统: macOS Big Sur 11.0.1
运行环境信息
- 端版本:PC Chrome浏览器 91.0.4472.114
- 手机机型:
Source: didi/chameleon