From dbd500e294efa782e16fc74da83a5b80c5a73d8c Mon Sep 17 00:00:00 2001 From: Mike Lischke Date: Thu, 7 Sep 2023 15:44:42 +0200 Subject: [PATCH] Make it ESM. --- package.json | 2 +- readme.md | 1 + tsconfig.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 545a5e7..af72efb 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "grammar", "parser" ], - "type": "commonjs", + "type": "module", "main": "./lib/index.js", "scripts": { "build": "tsc", diff --git a/readme.md b/readme.md index ae6d3a2..ec17cd4 100644 --- a/readme.md +++ b/readme.md @@ -222,6 +222,7 @@ The last two options potentially create a lot of output which can significantly ### 3.2.0 - A new [TypeScript runtime](https://github.com/mike-lischke/antlr4ng) powers this package now (antlr4ng). +- The package is now published as ES module, which is supported by all modern browsers and Node.js. ### 3.1.1 diff --git a/tsconfig.json b/tsconfig.json index 7297b9f..71b64ae 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "declaration": true, "module": "Node16", "target": "ES2022", - "moduleResolution": "node", + "moduleResolution": "Node16", "outDir": "lib", "rootDir": ".", "removeComments": false,