Add `default` option to exports in package.json
parent
9a03549424
commit
7f11861ed9
|
@ -15,6 +15,7 @@
|
|||
},
|
||||
"main": "./index.ts",
|
||||
"module": "./index.ts",
|
||||
"types": "./index.ts",
|
||||
"publishConfig": {
|
||||
"main": "./index.mjs",
|
||||
"module": "./index.mjs",
|
||||
|
@ -22,7 +23,8 @@
|
|||
"exports": {
|
||||
".": {
|
||||
"types": "./index.d.mts",
|
||||
"import": "./index.mjs"
|
||||
"import": "./index.mjs",
|
||||
"default": "./index.mjs"
|
||||
}
|
||||
},
|
||||
"directory": "dist",
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"url": "https://github.com/primefaces/primevue/issues"
|
||||
},
|
||||
"main": "./src/index.js",
|
||||
"module": "./src/index.js",
|
||||
"types": "./src/index.d.ts",
|
||||
"exports": {
|
||||
"./api": "./src/api/Api.js",
|
||||
|
@ -31,15 +32,18 @@
|
|||
},
|
||||
"publishConfig": {
|
||||
"main": "./index.mjs",
|
||||
"module": "./index.mjs",
|
||||
"types": "./index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./index.d.ts",
|
||||
"import": "./index.mjs"
|
||||
"import": "./index.mjs",
|
||||
"default": "./index.mjs"
|
||||
},
|
||||
"./*": {
|
||||
"types": "./*/index.d.ts",
|
||||
"import": "./*/index.mjs"
|
||||
"import": "./*/index.mjs",
|
||||
"default": "./*/index.mjs"
|
||||
}
|
||||
},
|
||||
"directory": "dist",
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
"exports": {
|
||||
".": {
|
||||
"types": "./index.d.mts",
|
||||
"import": "./index.mjs"
|
||||
"import": "./index.mjs",
|
||||
"default": "./index.mjs"
|
||||
}
|
||||
},
|
||||
"directory": "dist",
|
||||
|
|
|
@ -76,7 +76,7 @@ export function copyDependencies(inFolder, outFolder, subFolder) {
|
|||
});
|
||||
}
|
||||
|
||||
export async function renameDTSFile(dir, newName) {
|
||||
export async function renameDTSFile(dir, newName, resolver) {
|
||||
const entries = await fs.readdir(dir, { withFileTypes: true });
|
||||
|
||||
for (const entry of entries) {
|
||||
|
@ -84,7 +84,7 @@ export async function renameDTSFile(dir, newName) {
|
|||
|
||||
if (entry.isDirectory()) {
|
||||
await renameDTSFile(fullPath, newName);
|
||||
} else if (entry.name.endsWith('.d.ts')) {
|
||||
} else if (entry.name.endsWith('.d.ts') && (resolver?.(entry.name, dir) ?? true)) {
|
||||
const newFullPath = path.join(dir, `${newName}.d.ts`);
|
||||
|
||||
await fs.rename(fullPath, newFullPath);
|
||||
|
|
Loading…
Reference in New Issue