-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the esm wrapper, rely on commonjs autodetection (#599)
* Remove the esm wrapper, rely on commonjs autodetection Fixes #598
- Loading branch information
Showing
5 changed files
with
38 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
'use strict' | ||
const semver = require('semver') | ||
|
||
;(async () => { | ||
try { | ||
await import('./esm-wrapper.mjs') | ||
} catch (e) { | ||
if (e.message === 'Not supported') { | ||
require('tap') // shows skipped | ||
return | ||
if (!semver.satisfies(process.version, '>= v14.13.0 || ^12.20.0')) { | ||
require('tap') // shows skipped | ||
} else { | ||
;(async () => { | ||
try { | ||
await import('./esm-wrapper.mjs') | ||
} catch (e) { | ||
if (e.message === 'Not supported') { | ||
require('tap') // shows skipped | ||
return | ||
} | ||
console.error(e.stack) | ||
process.exitCode = 1 | ||
} | ||
console.error(e.stack) | ||
process.exitCode = 1 | ||
} | ||
})() | ||
})() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.