Unverified Commit aaa823c3 authored by LongYinan's avatar LongYinan Committed by GitHub

Interpolate default exports is now unnecessary (#36065)



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
parent 4f3e9e10
...@@ -14,11 +14,7 @@ module.exports = function (task) { ...@@ -14,11 +14,7 @@ module.exports = function (task) {
function* ( function* (
file, file,
serverOrClient, serverOrClient,
{ { stripExtension, keepImportAssertions = false } = {}
stripExtension,
keepImportAssertions = false,
interopClientDefaultExport = false,
} = {}
) { ) {
// Don't compile .d.ts // Don't compile .d.ts
if (file.base.endsWith('.d.ts')) return if (file.base.endsWith('.d.ts')) return
...@@ -117,15 +113,6 @@ module.exports = function (task) { ...@@ -117,15 +113,6 @@ module.exports = function (task) {
if (output.map) { if (output.map) {
const map = `${file.base}.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}`) output.code += Buffer.from(`\n//# sourceMappingURL=${map}`)
// add sourcemap to `files` array // add sourcemap to `files` array
......
...@@ -1826,7 +1826,7 @@ export async function nextbuild(task, opts) { ...@@ -1826,7 +1826,7 @@ export async function nextbuild(task, opts) {
export async function client(task, opts) { export async function client(task, opts) {
await task await task
.source(opts.src || 'client/**/*.+(js|ts|tsx)') .source(opts.src || 'client/**/*.+(js|ts|tsx)')
.swc('client', { dev: opts.dev, interopClientDefaultExport: true }) .swc('client', { dev: opts.dev })
.target('dist/client') .target('dist/client')
notify('Compiled client files') notify('Compiled client files')
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment