fix: types not available on esm packaging #430

This commit is contained in:
arthurfiorette 2022-12-25 17:15:58 -03:00
parent 7d82c5a46f
commit 00fdff0158
No known key found for this signature in database
GPG Key ID: 9D190CD53C53C555
4 changed files with 12 additions and 15 deletions

View File

@ -2,7 +2,7 @@ node_modules
/ignore /ignore
/coverage /coverage
# /dist /dist
/dev /dev
/tsconfig.json /tsconfig.json

View File

@ -116,15 +116,10 @@ module.exports = [
// Browser Bundle // Browser Bundle
config({ config({
esTarget: 'es5', // Use ES5 for UMD builds to support more browsers // Uses ES5 for UMD builds to support more browsers
esTarget: 'es5',
output: 'dist/index.bundle.js', output: 'dist/index.bundle.js',
libraryType: 'umd', libraryType: 'umd',
libraryName: 'AxiosCacheInterceptor' libraryName: 'AxiosCacheInterceptor'
}),
config({
output: 'dev/index.bundle.js',
libraryType: 'umd',
libraryName: 'AxiosCacheInterceptor',
devBuild: true
}) })
]; ];

View File

@ -7,16 +7,18 @@
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"module": "./dist/index.mjs", "module": "./dist/index.mjs",
"exports": { "exports": {
"./*": "./*",
"./package.json": "./package.json",
".": { ".": {
"import": "./dist/index.mjs", "import": "./dist/index.mjs",
"require": "./dist/index.cjs" "require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
}, },
"./dev": { "./dev": {
"import": "./dev/index.mjs", "import": "./dev/index.mjs",
"require": "./dev/index.cjs" "require": "./dev/index.cjs",
} "types": "./dist/index.d.ts"
},
"./package.json": "./package.json",
"./*": "./*"
}, },
"jsdelivr": "./dist/index.bundle.js", "jsdelivr": "./dist/index.bundle.js",
"unpkg": "./dist/index.bundle.js", "unpkg": "./dist/index.bundle.js",
@ -85,4 +87,4 @@
"engines": { "engines": {
"node": ">=12" "node": ">=12"
} }
} }

View File

@ -97,5 +97,5 @@
"skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true /* Skip type checking all .d.ts files. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */
}, },
"include": ["src", "test", "examples", "docs", "build","vitepress-docs"] "include": ["src", "test", "examples", "docs", "build"]
} }