Skip to content

Commit b5be498

Browse files
committed
Refactor project to use ES modules and update related scripts
1 parent a8dfd6a commit b5be498

8 files changed

+8
-7
lines changed

eslint.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default [
6262
}
6363
},
6464
{
65-
files: ["po/po2js", "po/xgettext-html"],
65+
files: ["po/po2js.cjs", "po/xgettext-html.cjs"],
6666
languageOptions: {
6767
globals: {
6868
...globals.node,
File renamed without changes.

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.6.0",
44
"description": "An HTML5 VNC client",
55
"browser": "lib/rfb",
6+
"type": "module",
67
"directories": {
78
"lib": "lib",
89
"doc": "docs",
@@ -17,9 +18,9 @@
1718
"docs/LICENSE*"
1819
],
1920
"scripts": {
20-
"lint": "eslint app core po/po2js po/xgettext-html tests utils",
21-
"test": "karma start karma.conf.js",
22-
"prepublish": "node ./utils/convert.js --clean"
21+
"lint": "eslint app core po/po2js.cjs po/xgettext-html.cjs tests utils",
22+
"test": "karma start karma.conf.cjs",
23+
"prepare": "node ./utils/convert.cjs --clean"
2324
},
2425
"repository": {
2526
"type": "git",

po/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ update-js: $(JSONFILES)
1515
%.po: FORCE
1616
msgmerge --update --lang=$* $@ noVNC.pot
1717
../app/locale/%.json: FORCE
18-
./po2js $*.po $@
18+
./po2js.cjs $*.po $@
1919

2020
update-pot:
2121
xgettext --output=noVNC.js.pot \
@@ -29,7 +29,7 @@ update-pot:
2929
../app/*.js \
3030
../core/*.js \
3131
../core/input/*.js
32-
./xgettext-html --output=noVNC.html.pot \
32+
./xgettext-html.cjs --output=noVNC.html.pot \
3333
../vnc.html
3434
msgcat --output-file=noVNC.pot \
3535
--sort-by-file noVNC.js.pot noVNC.html.pot

po/po2js renamed to po/po2js.cjs

File renamed without changes.
File renamed without changes.

utils/convert.js renamed to utils/convert.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function makeLibFiles(sourceMaps) {
6464
plugins: [],
6565
presets: [
6666
[ '@babel/preset-env',
67-
{ modules: 'commonjs' } ]
67+
{ modules: false } ]
6868
],
6969
ast: false,
7070
sourceMaps: sourceMaps,
File renamed without changes.

0 commit comments

Comments
 (0)