bunchee
Advanced tools
Comparing version 5.0.0-beta.1 to 5.0.0-beta.2
@@ -192,5 +192,6 @@ #!/usr/bin/env node | ||
if (typeof exportValue === 'string') { | ||
exportTypes.add(exportKey.startsWith('./') ? 'default' : exportKey); | ||
const composedTypes = new Set(exportTypes); | ||
composedTypes.add(exportKey.startsWith('.') ? 'default' : exportKey); | ||
const exportInfo = exportToDist.get(currentPath); | ||
const exportCondition = Array.from(exportTypes).join('.'); | ||
const exportCondition = Array.from(composedTypes).join('.'); | ||
if (!exportInfo) { | ||
@@ -258,2 +259,5 @@ const outputConditionPair = [ | ||
const childPath = isExportPath ? joinRelativePath(currentPath, exportKey) : currentPath; | ||
if (!isExportPath) { | ||
exportTypes.add(exportKey); | ||
} | ||
collectExportPath(exportValue, exportKey, childPath, exportTypes, exportToDist); | ||
@@ -284,3 +288,4 @@ } | ||
} | ||
if (pkg.main || pkg.module) { | ||
// Handle package.json global exports fields | ||
if (pkg.main || pkg.module || pkg.types) { | ||
const mainExportPath = pkg.main; | ||
@@ -292,3 +297,3 @@ const moduleExportPath = pkg.module; | ||
...existingExportInfo || [], | ||
[ | ||
Boolean(mainExportPath) && [ | ||
mainExportPath, | ||
@@ -460,3 +465,3 @@ getMainFieldExportType(pkg) | ||
var version = "5.0.0-beta.1"; | ||
var version = "5.0.0-beta.2"; | ||
@@ -503,3 +508,3 @@ function relativify(path) { | ||
exportType = value; | ||
} else if (value === 'import' || value === 'require') { | ||
} else if (value === 'import' || value === 'require' || value === 'types') { | ||
exportType = value; | ||
@@ -506,0 +511,0 @@ } |
{ | ||
"name": "bunchee", | ||
"version": "5.0.0-beta.1", | ||
"version": "5.0.0-beta.2", | ||
"description": "zero config bundler for js/ts/jsx libraries", | ||
@@ -113,3 +113,3 @@ "bin": "./dist/bin/cli.js", | ||
"clean": "rm -rf ./dist", | ||
"typecheck": "tsc --noEmit", | ||
"typecheck": "tsc --noEmit && tsc -p test/tsconfig.json --noEmit", | ||
"build": "tsx ./src/bin/index.ts --runtime node", | ||
@@ -116,0 +116,0 @@ "format": "prettier --write ." |
@@ -47,3 +47,3 @@ # bunchee | ||
# Use bunchee to prepare package.json configuration | ||
npm bunchee --prepare | ||
npm exec bunchee --prepare | ||
# "If you're using other package manager such as pnpm" | ||
@@ -50,0 +50,0 @@ # pnpm bunchee --prepare |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
192662
4409
6