fix: not use deprecated option esm in resolver

This commit is contained in:
Clark Du 2019-01-16 17:24:36 +00:00
parent a1782600f7
commit 5f6361f6db

View File

@ -133,13 +133,13 @@ export default class Resolver {
}
// Disable esm for ts files by default
if (esm === undefined && /.ts$/.test(resolvedPath)) {
esm = false
if (useESM === undefined && /.ts$/.test(resolvedPath)) {
useESM = false
}
// Try to require
try {
if (esm === false) {
if (useESM === false) {
requiredModule = require(resolvedPath)
} else {
requiredModule = this.esm(resolvedPath)