Skip to content

Commit bd73bbc

Browse files
committed
remove custom handling for various node v12 versions of experimental loaders
1 parent 93cfca0 commit bd73bbc

File tree

5 files changed

+4
-32
lines changed

5 files changed

+4
-32
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
script: npm run lint
55
language: node_js
66
node_js:
7+
- 18
78
- 16
89
- 14
9-
- 12
1010
sudo: false

lib/index.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,11 @@ module.exports = function (
9696

9797
args.push(`--require=${resolveMain(localPath('wrap'))}`);
9898

99-
if (semver.satisfies(process.version, '<12.17.0')) {
100-
args.push('--experimental-modules');
101-
}
102-
103-
const loaderName = semver.satisfies(process.version, '>=16.12.0')
104-
? 'load'
105-
: semver.satisfies(process.version, '>=12.11.1')
106-
? 'get-format'
107-
: 'resolve';
99+
const loaderName = semver.satisfies(process.version, '>=16.12.0') ? 'load' : 'get-format';
108100

109101
const loaderURL = pathToFileURL(resolveMain(localPath(join('loaders', `${loaderName}.mjs`))));
110102

111-
const experimentalPrefix = semver.satisfies(process.version, '>=12.11.1')
112-
? 'experimental-'
113-
: '';
114-
115-
args.push(`--${experimentalPrefix}loader=${loaderURL.href}`);
103+
args.push(`--experimental-loader=${loaderURL.href}`);
116104

117105
child = fork(script, scriptArgs, {
118106
cwd: process.cwd(),

lib/loaders/resolve.mjs

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"main": "./lib",
2626
"engines": {
27-
"node": ">=12"
27+
"node": ">=14"
2828
},
2929
"scripts": {
3030
"lint": "eslint lib test bin/node-dev",

test/spawn/esmodule.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
const semver = require('semver');
21
const tap = require('tap');
32

43
const { spawn, touchFile } = require('../utils');
54

65
tap.test('Supports ECMAScript modules with experimental-specifier-resolution', t => {
7-
if (semver.satisfies(process.version, '<12.17'))
8-
return t.skip('experimental-specifier-resolution requires node >= 12.17');
9-
106
spawn('--experimental-specifier-resolution=node resolution.mjs', out => {
117
if (out.match(/touch message.js/)) {
128
touchFile('message.js');

0 commit comments

Comments
 (0)