From 9eaca2369131905cf7998b4d19a4e6969f54bfa6 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Fri, 10 Jan 2025 10:06:31 +0900 Subject: [PATCH 1/3] add esmodule support --- scripts/prepublish.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/prepublish.js b/scripts/prepublish.js index b23bb73..400fe85 100644 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -15,3 +15,4 @@ if (!regex.test(sourceContents)) { const outputContents = sourceContents.replace(regex, output); fs.writeFileSync(path.resolve(__dirname, '../punycode.es6.js'), outputContents); +fs.writeFileSync(path.resolve(__dirname, '../punycode.es6.mjs'), outputContents); From fc01933fbdc897d177eb98096526dfd944d124e0 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Fri, 10 Jan 2025 10:08:08 +0900 Subject: [PATCH 2/3] use punycode.mjs --- scripts/prepublish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/prepublish.js b/scripts/prepublish.js index 400fe85..783556f 100644 --- a/scripts/prepublish.js +++ b/scripts/prepublish.js @@ -15,4 +15,4 @@ if (!regex.test(sourceContents)) { const outputContents = sourceContents.replace(regex, output); fs.writeFileSync(path.resolve(__dirname, '../punycode.es6.js'), outputContents); -fs.writeFileSync(path.resolve(__dirname, '../punycode.es6.mjs'), outputContents); +fs.writeFileSync(path.resolve(__dirname, '../punycode.mjs'), outputContents); From 390b165fa1d1bdbd7236a434690629fdeacbb1c1 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Fri, 10 Jan 2025 10:18:47 +0900 Subject: [PATCH 3/3] use punycode.mjs in jsnext:main and module --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b8b76fc..a985719 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.", "homepage": "https://mths.be/punycode", "main": "punycode.js", - "jsnext:main": "punycode.es6.js", - "module": "punycode.es6.js", + "jsnext:main": "punycode.mjs", + "module": "punycode.mjs", "engines": { "node": ">=6" },