We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const matchPath = function (p) { const files = [path.resolve(src/${p}.js), path.resolve(src/${p}.vue),path.resolve(src/${p}/index.js),path.resolve(src/${p}/index.vue)] for(const filePath of files){ if(fs.existsSync(filePath)){ return filePath } } return false }
src/${p}.js
src/${p}.vue
src/${p}/index.js
src/${p}/index.vue
增加下文件夹下index 的文件的处理
The text was updated successfully, but these errors were encountered:
使用 enhanced-resolve 来处理就更好了。。
Sorry, something went wrong.
@sanriqing 需求的目的?
老项目都是直接没有指向具体index的。。而且这样更符合resolve的标准实现
No branches or pull requests
const matchPath = function (p) {
const files = [path.resolve(
src/${p}.js
), path.resolve(src/${p}.vue
),path.resolve(src/${p}/index.js
),path.resolve(src/${p}/index.vue
)]for(const filePath of files){
if(fs.existsSync(filePath)){
return filePath
}
}
return false
}
增加下文件夹下index 的文件的处理
The text was updated successfully, but these errors were encountered: