Skip to content

Commit

Permalink
fix: only apply interop default flag for re-exported
Browse files Browse the repository at this point in the history
I really, really love glob.
  • Loading branch information
SukkaW committed Apr 26, 2022
1 parent a5b966a commit 47b967b
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions packages/next/taskfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1778,6 +1778,7 @@ export async function compile(task, opts) {
'telemetry',
'trace',
'shared',
'shared_re_exported',
'server_wasm',
// we compile this each time so that fresh runtime data is pulled
// before each publish
Expand Down Expand Up @@ -1916,18 +1917,39 @@ export default async function (task) {
await task.watch('cli/**/*.+(js|ts|tsx)', 'cli', opts)
await task.watch('telemetry/**/*.+(js|ts|tsx)', 'telemetry', opts)
await task.watch('trace/**/*.+(js|ts|tsx)', 'trace', opts)
await task.watch('shared/**/*.+(js|ts|tsx)', 'shared', opts)
await task.watch(
'shared/lib/{amp,config,constants,dynamic,head}.+(js|ts|tsx)',
'shared_re_exported',
opts
)
await task.watch(
'shared/**/!(amp|config|constants|dynamic|head).+(js|ts|tsx)',
'shared',
opts
)
await task.watch('server/**/*.+(wasm)', 'server_wasm', opts)
}

export async function shared(task, opts) {
await task
.source(opts.src || 'shared/**/*.+(js|ts|tsx)')
.swc('server', { dev: opts.dev, interopClientDefaultExport: true })
.source(
opts.src || 'shared/**/!(amp|config|constants|dynamic|head).+(js|ts|tsx)'
)
.swc('server', { dev: opts.dev })
.target('dist/shared')
notify('Compiled shared files')
}

export async function shared_re_exported(task, opts) {
await task
.source(
opts.src || 'shared/**/{amp,config,constants,dynamic,head}.+(js|ts|tsx)'
)
.swc('server', { dev: opts.dev, interopClientDefaultExport: true })
.target('dist/shared')
notify('Compiled shared re-exported files')
}

export async function server_wasm(task, opts) {
await task.source(opts.src || 'server/**/*.+(wasm)').target('dist/server')
notify('Moved server wasm files')
Expand Down

0 comments on commit 47b967b

Please sign in to comment.