-
Notifications
You must be signed in to change notification settings - Fork 28
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
require中有模版字符串没有解析 #16
Comments
@originjs/vite-plugin-commonjs会把require转换成import,所以模板字符串没办法支持。 @originjs/vit-plugin-commonjs will convert |
How about replacing |
node_modules/@originjs/vite-plugin-commonjs/lib/lib.js -const requireRegex = /{0,2}require\s*(\s*(["'].?["'])\s)/g; -importsString += 我也发现了这个问题,自己修改了下源码,使用 patch-package 本地打了个补丁 |
const img = require(
../../assets/imgs/white.svg
) //使用模版字符串 没有转换const img2 = require('../../assets/imgs/white.svg')
The text was updated successfully, but these errors were encountered: