From 5ad6f7ddc5164d480607c7ef78cce4685da05406 Mon Sep 17 00:00:00 2001 From: dm1sh Date: Wed, 4 Aug 2021 15:09:27 +0300 Subject: [PATCH] Fixed module type for production build --- package.json | 2 +- tsconfig.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3afd4e6..c20e82a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "./lib/**/*" ], "scripts": { - "test:browser": "npm run build && cp ./src/__tests__/index.html ./lib/ && bash -c 'for module in \".\\/cache\" \".\\/types\" \".\\/utils\"; do sed -i \"s/$module/$module.js/g\" ./lib/index.js; done' && serve -s lib", + "test:browser": "npm run build -- --module 'esnext' && cp ./src/__tests__/index.html ./lib/ && bash -c 'for module in \".\\/cache\" \".\\/types\" \".\\/utils\"; do sed -i \"s/$module/$module.js/g\" ./lib/index.js; done' && serve -s lib", "build": "tsc", "test": "jest --config jestconfig.json --passWithNoTests", "prepare": "npm run build", diff --git a/tsconfig.json b/tsconfig.json index 01a683f..750dd25 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es5", - "module": "ESNext", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "outDir": "./lib",