diff --git a/package.json b/package.json index f3b21a7..b61d93b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "description": "The JavaScript configuration provider for Azure App Configuration", "files": [ "dist/", - "types/", "LICENSE", "README.md" ], @@ -12,11 +11,11 @@ "./package.json": "./package.json", ".": { "import": { - "types": "./types/index.d.ts", + "types": "./dist/types/index.d.ts", "default": "./dist/esm/index.js" }, "require": { - "types": "./types/index.d.ts", + "types": "./dist/types/index.d.ts", "default": "./dist/commonjs/index.js" } } @@ -26,7 +25,7 @@ "build-test": "npm run build-test-esm && npm run build-test-cjs", "build-test-esm": "tsc -p ./tsconfig.test.esm.json && cpy esm-package.json out/esm --rename=package.json", "build-test-cjs": "tsc -p ./tsconfig.test.cjs.json && cpy cjs-package.json out/commonjs --rename=package.json", - "clean": "rimraf dist dist-esm out types", + "clean": "rimraf dist out", "dev": "rollup --config --watch", "lint": "eslint src/ test/ examples/ --ext .js,.ts,.mjs", "fix-lint": "eslint src/ test/ examples/ --fix --ext .js,.ts,.mjs", diff --git a/rollup.config.mjs b/rollup.config.mjs index b7c3f49..b9c547c 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -31,27 +31,13 @@ export default [ ], plugins: [ typescript({ - compilerOptions: { - "lib": [ - "DOM", - "WebWorker", - "ESNext" - ], - "skipDefaultLibCheck": true, - "module": "NodeNext", - "moduleResolution": "NodeNext", - "target": "ES2022", - "strictNullChecks": true, - "strictFunctionTypes": true, - "sourceMap": true, - "inlineSources": true - } + tsconfig: "./tsconfig.json", }) ], }, { input: "src/index.ts", - output: [{ file: "types/index.d.ts", format: "esm" }], + output: [{ file: "dist/types/index.d.ts", format: "esm" }], plugins: [dts()], }, ]; diff --git a/tsconfig.json b/tsconfig.json index 837eaf6..e253840 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,20 +1,30 @@ { "compilerOptions": { + // Include ES2022 (modern JS), ESNext (future features), DOM and web worker APIs for browser support. "lib": [ "DOM", "WebWorker", "ESNext", "ES2022" ], - "skipDefaultLibCheck": true, - "moduleResolution": "Node", + // Generate modern JavaScript syntax compatible with Node 18+ and modern browsers. "target": "ES2022", + + // Use Node-style resolution to locate imports + "moduleResolution": "Node", + + // Allow default imports from CommonJS modules. + "allowSyntheticDefaultImports": true, + "esModuleInterop": true, + + // Ensure strict type-checking "strictNullChecks": true, "strictFunctionTypes": true, + "skipDefaultLibCheck": true, + + // Generate source maps and inline original TypeScript sources for debugging. "sourceMap": true, "inlineSources": true, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true }, "exclude": [ "node_modules",