mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
5e3bf6e537
* Convert render.js to typescript * Compile tsx files too * Remove internal renderErrorToHTML function * Interopt component result * requirePage doesn’t need async * Move out enhancing logic into it’s own function * Remove buildManifest from renderPage * Move render into it’s own function * Change let to const * Move renderDocument into it’s own function
36 lines
931 B
JavaScript
36 lines
931 B
JavaScript
const notifier = require('node-notifier')
|
|
|
|
export async function lib (task, opts) {
|
|
await task.source(opts.src || 'lib/**/*.+(js|ts|tsx)').typescript({module: 'commonjs'}).target('dist/lib')
|
|
notify('Compiled lib files')
|
|
}
|
|
|
|
export async function server (task, opts) {
|
|
await task.source(opts.src || 'server/**/*.+(js|ts|tsx)').typescript({module: 'commonjs'}).target('dist/server')
|
|
notify('Compiled server files')
|
|
}
|
|
|
|
export async function build (task) {
|
|
await task.parallel(['server', 'lib'])
|
|
}
|
|
|
|
export default async function (task) {
|
|
await task.clear('dist')
|
|
await task.start('build')
|
|
await task.watch('server/**/*.+(js|ts|tsx)', 'server')
|
|
await task.watch('lib/**/*.+(js|ts|tsx)', 'lib')
|
|
}
|
|
|
|
export async function release (task) {
|
|
await task.clear('dist').start('build')
|
|
}
|
|
|
|
// notification helper
|
|
function notify (msg) {
|
|
return notifier.notify({
|
|
title: '▲ Next',
|
|
message: msg,
|
|
icon: false
|
|
})
|
|
}
|