vant/packages/vant-eslint-config/jest.resolver.js
zoy-l 07dfa9b981
chore(eslint-config): update dependencies test cases (#10221)
* chore(eslint-config): update dependencies, test cases

* chore: update file .lock

* fix: wrong .lock file

* fix: code style

* chore: update `eslint-plugin-vue`
2022-01-30 11:13:54 +08:00

14 lines
514 B
JavaScript

// https://github.com/facebook/jest/issues/9771#issuecomment-871585234
const resolver = require('enhanced-resolve').create.sync({
conditionNames: ['require', 'node', 'default'],
extensions: ['.js', '.json', '.node', '.ts', '.tsx'],
});
module.exports = function (request, options) {
// list global module that must be resolved by defaultResolver here
if (['fs', 'http', 'path'].includes(request)) {
return options.defaultResolver(request, options);
}
return resolver(options.basedir, request);
};