-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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.context doesn't work in version 3.0.2 #6920
Milestone
Comments
试试最后用 / 结尾 |
试过了的 这样也会报错 当扫描的目录的根目录存在index.js文件时就会出现错误 |
@zeroooooooo 复现不了,升级到最新版本再试试,或者提供一下 demo 吧。 // Taro 项目配置
config: {
alias: {
'@/src': path.resolve(__dirname, '../src')
}
...
} // 读取 src 下所有 xxx.config.js
const r = require.context('@/src', true, /(\w)+\.config\.js$/)
console.log('r: ', r.keys()) // 像 #6720 一样,读取当前页面文件夹下的配置文件
const r = require.context('./', true, /(\w)+\.config\.js$/)
console.log('r: ', r.keys()) |
Chen-jj
added a commit
that referenced
this issue
Sep 1, 2020
10 tasks
10 tasks
Chen-jj
added a commit
that referenced
this issue
Sep 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
相关平台
微信小程序
小程序基础库: 2.11.1
使用框架: React
复现步骤
const test = require.context( '@/store/test', true, /config.\w .js$/);
期望结果
require.context can work as usual
实际结果
环境信息
补充信息
related issues : #6720
The text was updated successfully, but these errors were encountered: