Skip to content

Commit

Permalink
fix incorrect entrypoint labels
Browse files Browse the repository at this point in the history
  • Loading branch information
dcastil committed Jun 23, 2024
1 parent a496d56 commit a25b6a1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/actions/metrics-report/src/get-package-size.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async function getEntryPointSizes({ shouldOmitFailures }) {
(error) => {
if (shouldOmitFailures) {
core.info(
`Failed to get bundle for ${entryPointConfig.entryPointPath}: ${error.message}`,
`Failed to get bundle for ${entryPointConfig.entryPoint}: ${error.message}`,
)
return
}
Expand All @@ -72,7 +72,7 @@ async function getEntryPointSizes({ shouldOmitFailures }) {
}

const [bundleSize, singleExportSizes] = await Promise.all([
getBundleSize(entryPointConfig.entryPointPath, bundle),
getBundleSize(entryPointConfig.entryPoint, bundle),
getSingleExportBundleSizes(
entryPointConfig,
entryPointIndex,
Expand All @@ -96,7 +96,7 @@ async function getEntryPointSizes({ shouldOmitFailures }) {

/**
* @typedef {object} EntryPointConfiguration
* @property {string} entryPointPath
* @property {string} entryPoint
* @property {string} bundlePath
* @property {'esm' | 'cjs'} format
*/
Expand All @@ -108,22 +108,22 @@ async function getEntryPointConfigs() {
const pkg = (await import('../../../../package.json', { assert: { type: 'json' } })).default

return Object.entries(pkg.exports).flatMap(([relativeEntryPointPath, bundleObject]) => {
const entryPointPath = path.resolve('tailwind-merge', relativeEntryPointPath)
const entryPointPath = path.join('tailwind-merge', relativeEntryPointPath)

/** @type {EntryPointConfiguration[]} */
const entryPointConfigs = []

if (bundleObject.import) {
entryPointConfigs.push({
entryPointPath,
entryPoint: entryPointPath + ' esm',
bundlePath: bundleObject.import,
format: 'esm',
})
}

if (bundleObject.require) {
entryPointConfigs.push({
entryPointPath,
entryPoint: entryPointPath + ' cjs',
bundlePath: bundleObject.require,
format: 'cjs',
})
Expand Down

0 comments on commit a25b6a1

Please sign in to comment.