Skip to content

Commit

Permalink
Interpolate default exports is now unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Apr 11, 2022
1 parent 4f3e9e1 commit 241f783
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
15 changes: 1 addition & 14 deletions packages/next/taskfile-swc.js
Expand Up @@ -14,11 +14,7 @@ module.exports = function (task) {
function* (
file,
serverOrClient,
{
stripExtension,
keepImportAssertions = false,
interopClientDefaultExport = false,
} = {}
{ stripExtension, keepImportAssertions = false } = {}
) {
// Don't compile .d.ts
if (file.base.endsWith('.d.ts')) return
Expand Down Expand Up @@ -117,15 +113,6 @@ module.exports = function (task) {
if (output.map) {
const map = `${file.base}.map`

if (interopClientDefaultExport) {
output.code += `
if (typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) {
Object.assign(exports.default, exports);
module.exports = exports.default;
}
`
}

output.code += Buffer.from(`\n//# sourceMappingURL=${map}`)

// add sourcemap to `files` array
Expand Down
2 changes: 1 addition & 1 deletion packages/next/taskfile.js
Expand Up @@ -1826,7 +1826,7 @@ export async function nextbuild(task, opts) {
export async function client(task, opts) {
await task
.source(opts.src || 'client/**/*.+(js|ts|tsx)')
.swc('client', { dev: opts.dev, interopClientDefaultExport: true })
.swc('client', { dev: opts.dev })
.target('dist/client')
notify('Compiled client files')
}
Expand Down

0 comments on commit 241f783

Please sign in to comment.