Skip to content

Commit

Permalink
fix: use default export with cjs transform
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed May 24, 2021
1 parent 20f607f commit 68e1ed1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/loaders/js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const jsLoader: Loader = async (input, { options }) => {
const isCjs = options.format === 'cjs'
if (isCjs) {
contents = jiti().transform({ source: contents, retainLines: false })
.replace(/^exports.default = /mg, 'module.exports = ')
}

output.push({
Expand Down

0 comments on commit 68e1ed1

Please sign in to comment.