diff --git a/eslint.config.mjs b/eslint.config.mjs index 10a99ce1..3b055296 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -62,7 +62,7 @@ export default [ } }, { - files: ["po/po2js", "po/xgettext-html"], + files: ["po/po2js.cjs", "po/xgettext-html.cjs"], languageOptions: { globals: { ...globals.node, diff --git a/karma.conf.js b/karma.conf.cjs similarity index 100% rename from karma.conf.js rename to karma.conf.cjs diff --git a/package.json b/package.json index bfe16a54..8779797d 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.6.0", "description": "An HTML5 VNC client", "browser": "lib/rfb", + "type": "module", "directories": { "lib": "lib", "doc": "docs", @@ -17,9 +18,9 @@ "docs/LICENSE*" ], "scripts": { - "lint": "eslint app core po/po2js po/xgettext-html tests utils", - "test": "karma start karma.conf.js", - "prepublish": "node ./utils/convert.js --clean" + "lint": "eslint app core po/po2js.cjs po/xgettext-html.cjs tests utils", + "test": "karma start karma.conf.cjs", + "prepare": "node ./utils/convert.cjs --clean" }, "repository": { "type": "git", diff --git a/po/Makefile b/po/Makefile index dcf5ba44..e31056b0 100644 --- a/po/Makefile +++ b/po/Makefile @@ -15,7 +15,7 @@ update-js: $(JSONFILES) %.po: FORCE msgmerge --update --lang=$* $@ noVNC.pot ../app/locale/%.json: FORCE - ./po2js $*.po $@ + ./po2js.cjs $*.po $@ update-pot: xgettext --output=noVNC.js.pot \ @@ -29,7 +29,7 @@ update-pot: ../app/*.js \ ../core/*.js \ ../core/input/*.js - ./xgettext-html --output=noVNC.html.pot \ + ./xgettext-html.cjs --output=noVNC.html.pot \ ../vnc.html msgcat --output-file=noVNC.pot \ --sort-by-file noVNC.js.pot noVNC.html.pot diff --git a/po/po2js b/po/po2js.cjs similarity index 100% rename from po/po2js rename to po/po2js.cjs diff --git a/po/xgettext-html b/po/xgettext-html.cjs similarity index 100% rename from po/xgettext-html rename to po/xgettext-html.cjs diff --git a/utils/convert.js b/utils/convert.cjs similarity index 99% rename from utils/convert.js rename to utils/convert.cjs index 617f4ed6..35dfe9e8 100755 --- a/utils/convert.js +++ b/utils/convert.cjs @@ -64,7 +64,7 @@ function makeLibFiles(sourceMaps) { plugins: [], presets: [ [ '@babel/preset-env', - { modules: 'commonjs' } ] + { modules: false } ] ], ast: false, sourceMaps: sourceMaps, diff --git a/utils/genkeysymdef.js b/utils/genkeysymdef.cjs similarity index 100% rename from utils/genkeysymdef.js rename to utils/genkeysymdef.cjs