Skip to content

Commit

Permalink
Fix legal comments output path
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim committed Jan 21, 2023
1 parent 6ee7cea commit 95ee87d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/few-pugs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nanobundle": patch
---

Fix legal comments output path
8 changes: 3 additions & 5 deletions src/tasks/buildBundleTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ async function buildBundleGroup({
entryPointsEntries.push([
path.relative(
baseDir,
// FIXME: add normal CSS bundle support instead of this ad-hoc handling
entry.outputFile.replace(/\.css$/, ''),
entry.outputFile.replace(/\.[^\.]+$/, ''),
),
sourceFile,
]);
Expand All @@ -154,6 +153,7 @@ async function buildBundleGroup({
entryPoints,
outdir: baseDir,
bundle: true,
tsconfig: context.tsconfigPath,
jsx: context.jsx,
jsxDev: context.jsxDev,
jsxFactory: context.jsxFactory,
Expand Down Expand Up @@ -203,9 +203,7 @@ async function buildBundleGroup({

const outputFiles = result.outputFiles.map(outputFile => ({
...outputFile,
path: outputFile.path
.replace(/\.js$/, '')
.replace(/\.js\.map$/, '.map'),
path: outputFile.path,
}));

return {
Expand Down
1 change: 1 addition & 0 deletions src/tasks/reportEmitResultsTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export async function reportEmitResultsTask({
}: ReportEmitResultsTaskOptions): Promise<void> {
const bundles = bundleOutputs
.filter(bundle => !bundle.path.endsWith('.map'))
.filter(bundle => !bundle.path.endsWith('.LEGAL.txt'))
const lastBundle = bundles.at(-1);
const plural = bundles.length !== 1;

Expand Down

0 comments on commit 95ee87d

Please sign in to comment.