farm-fe / farm

Extremely fast Vite-compatible web build tool written in Rust
https://farmfe.org
MIT License
4.95k stars 163 forks source link

[Bug Report]: import.meta.glob is not a function #1833

Open mxyhi opened 4 days ago

mxyhi commented 4 days ago

Steps to reproduce

console.log(mods);

- log
```log
module.meta.glob is not a function

Reproduce link

No response

What is actually happening?

const mods = import.meta.glob(`./**/*`);

console.log(mods);

System Info

Uncaught TypeError: module.meta.glob is not a function
wre232114 commented 3 days ago

replace

const mods = import.meta.glob(`./**/*`);

with

 import.meta.glob('./**/*');

Using string literal instead of template string

mxyhi commented 1 day ago

取代

const mods = import.meta.glob(`./**/*`);

 import.meta.glob('./**/*');

使用 string literal 而不是 template string

???

wre232114 commented 1 day ago

glob 里面用字符串常量,比如 import.meta.glob('./**/*');。用模版字符串(./**/*)的话会视为一个变量,无法静态分析