From 305110ff1a2dde8705c9f114ed4ae5f8352a9505 Mon Sep 17 00:00:00 2001 From: Andrea Maccis Date: Sat, 17 May 2025 18:39:00 +0200 Subject: [PATCH 1/3] Fix ESM settings --- package.json | 1 + tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e481bf5..9b64eea 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "3.0.0", "description": "A Node.js interface to the Snowball stemming algorithms", "main": "lib/index.js", + "type": "module", "scripts": { "test": "jest", "build": "tsc" diff --git a/tsconfig.json b/tsconfig.json index daa4a77..eb0aeb9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es2022", - "module": "commonjs", + "module": "esnext", "declaration": true, "outDir": "./lib", "strict": true From 48393e0906b4bb88ec64d8aff928b6c1b8577cad Mon Sep 17 00:00:00 2001 From: Andrea Maccis Date: Sat, 17 May 2025 18:42:52 +0200 Subject: [PATCH 2/3] Fix ESM settings --- jest.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jest.config.js b/jest.config.js index 8cbf894..e946bca 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,5 @@ /** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ -module.exports = { +export default { preset: 'ts-jest', testEnvironment: 'node', }; \ No newline at end of file From 6600908954abed3162551a01abfc459a0dab91f2 Mon Sep 17 00:00:00 2001 From: Andrea Maccis Date: Sat, 17 May 2025 18:56:59 +0200 Subject: [PATCH 3/3] Fix ESM settings --- tsconfig.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index eb0aeb9..4a98bed 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,9 @@ "module": "esnext", "declaration": true, "outDir": "./lib", - "strict": true + "strict": true, + "moduleResolution": "node", + "esModuleInterop": true }, "include": ["src"], "exclude": ["node_modules", "**/__tests__/*"]