Skip to content

Commit

Permalink
fix: ensure filename for esm format (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist authored Jun 21, 2020
1 parent 4aae8f0 commit fe897b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,16 @@ export class Bundler {
typeof getFileName === 'function'
? getFileName({ format: rollupFormat, minify }, defaultFileName)
: getFileName
const fileName = fileNameTemplate
let fileName = fileNameTemplate
.replace(/\[min\]/, minPlaceholder)
// The `[ext]` placeholder no longer makes sense
// Since we only output to `.js` now
// Probably remove it in the future
.replace(/\[ext\]/, '.js')

if (rollupFormat === 'esm') {
fileName = fileName.replace(/\[format\]/, 'esm')
}

return {
inputConfig: {
Expand Down

1 comment on commit fe897b2

@vercel
Copy link

@vercel vercel bot commented on fe897b2 Jun 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.