diff --git a/karma.conf.js b/karma.conf.js index b2cf910..a7a4e63 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -42,7 +42,10 @@ module.exports = function (config) { customLaunchers: browserstack, karmaTypescriptConfig: { coverageOptions: { - exclude: /^src{\/|\\}test{\/|\\}/, + exclude: /test\//, + }, + compilerOptions: { + module: 'commonjs' }, tsconfig: './tsconfig.json', include: { diff --git a/package-lock.json b/package-lock.json index c97be9e..b3135d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9268,6 +9268,12 @@ "integrity": "sha512-tdzBRDGWcI1OpPVmChbdSKhvSVurznZ8X36AYURAcl+0o2ldlCY2XPzyXNNxwJwwyIU+rIglTCG4kxtNKBQH7Q==", "dev": true }, + "tsconfigs": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/tsconfigs/-/tsconfigs-4.0.2.tgz", + "integrity": "sha512-Po+Hqetcu0P83zy6WHpT0bJIpXgKS+/N5mtiSpzxcTdjUbPNE2kijqUCZecwERHkVQt/mqNC6xzj/C92hs40qg==", + "dev": true + }, "tslib": { "version": "1.10.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", diff --git a/package.json b/package.json index d3b8e82..f88bb49 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "npm-run-all": "^4.1.5", "remark-cli": "^7.0.1", "remark-toc": "^6.0.0", + "tsconfigs": "^4.0.2", "typescript": "^3.7.2", "xyz": "2.1.0" }, @@ -52,8 +53,8 @@ "unit": "karma start", "test": "run-s lint compile unit", "compile": "npm run compile-es && npm run compile-commonjs", - "compile-es": "tsc --outDir es --module es6 --moduleResolution node", - "compile-commonjs": "tsc --outDir ./", + "compile-es": "tsc --outDir es --module es6", + "compile-commonjs": "tsc --outDir . --module commonjs", "prepublishOnly": "npm run compile", "release-major": "xyz --repo git@github.com:paldepind/snabbdom.git --increment major", "release-minor": "xyz --repo git@github.com:paldepind/snabbdom.git --increment minor", diff --git a/tsconfig.json b/tsconfig.json index ac45b4c..2002e08 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,15 +1,12 @@ { + "extends": "tsconfigs/browser-module", "compilerOptions": { + "strictFunctionTypes": false, + "strictBindCallApply": false, + "noImplicitThis": false, "target": "ES5", - "noImplicitAny": true, - "sourceMap": true, - "strictNullChecks": true, - "declaration": true, - "removeComments": false, - "noUnusedLocals": true, "jsx": "react", "jsxFactory": "jsx", - "esModuleInterop": true, "lib": [ "dom", "es5",