From 4145013885cc8a5a70d9244353749361d1dc6020 Mon Sep 17 00:00:00 2001 From: sinchang Date: Sun, 22 May 2022 15:02:06 +0800 Subject: [PATCH] fix: cannot use import statement outside a module --- package.json | 1 + tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ba03188..c3f5782 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "module": "./dist/qrcodeParser.es.js", "exports": "./dist/qrcodeParser.modern.js", "types": "./dist/index.d.ts", + "type": "module", "scripts": { "prepublishOnly": "npm run build", "test:cov": "jest --coverage", diff --git a/tsconfig.json b/tsconfig.json index 8b63ecc..0ca7844 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ESNext", "useDefineForClassFields": true, - "module": "ESNext", + "module": "commonjs", "lib": ["ESNext", "DOM"], "moduleResolution": "Node", "strict": true,