Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't include core-js for default _document #10187

Merged
merged 4 commits into from Jan 21, 2020
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 25 additions & 2 deletions packages/next/taskfile.js
Expand Up @@ -185,13 +185,36 @@ export async function nextbuildstatic(task, opts) {
notify('Compiled export files')
}

export async function pages(task, opts) {
export async function pages_app(task) {
await task
.source('pages/_app.tsx')
.babel(babelClientOpts)
.target('dist/pages')
}

export async function pages_error(task) {
await task
.source(opts.src || 'pages/**/*.+(js|ts|tsx)')
.source('pages/_error.tsx')
.babel(babelClientOpts)
.target('dist/pages')
}

export async function pages_document(task) {
const babelOpts = {
...babelServerOpts,
presets: [...babelServerOpts.presets, '@babel/preset-react'],
}

await task
.source('pages/_document.tsx')
.babel(babelOpts)
.target('dist/pages')
}

export async function pages(task, opts) {
await task.parallel(['pages_app', 'pages_error', 'pages_document'])
}

export async function telemetry(task, opts) {
await task
.source(opts.src || 'telemetry/**/*.+(js|ts|tsx)')
Expand Down