1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Move next export into it's own directory (#5084)

* Rename static to export in integration tests

* Move export functionality into it’s own directory

* Fix path
This commit is contained in:
Tim Neutkens 2018-09-04 11:21:00 +02:00 committed by GitHub
parent c44dab63ff
commit 625288796f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 12 additions and 5 deletions

View file

@ -2,7 +2,7 @@
import { resolve, join } from 'path'
import { existsSync } from 'fs'
import parseArgs from 'minimist'
import exportApp from '../server/export'
import exportApp from '../export'
import { printAndExit } from '../lib/utils'
const argv = parseArgs(process.argv.slice(2), {

View file

@ -3,9 +3,9 @@ import cp from 'recursive-copy'
import mkdirp from 'mkdirp-then'
import { extname, resolve, join, dirname, sep } from 'path'
import { existsSync, readFileSync, writeFileSync } from 'fs'
import loadConfig from './config'
import loadConfig from '../server/config'
import {PHASE_EXPORT, SERVER_DIRECTORY, PAGES_MANIFEST, CONFIG_FILE, BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH} from '../lib/constants'
import { renderToHTML } from './render'
import { renderToHTML } from '../server/render'
import { setAssetPrefix } from '../lib/asset'
import * as envConfig from '../lib/runtime-config'

View file

@ -5,7 +5,7 @@ const mkdirp = require('mkdirp')
const isWindows = /^win/.test(process.platform)
export async function compile (task) {
await task.parallel(['bin', 'server', 'nextbuild', 'lib', 'client'])
await task.parallel(['bin', 'server', 'nextbuild', 'nextbuildstatic', 'lib', 'client'])
}
export async function bin (task, opts) {
@ -33,6 +33,12 @@ export async function client (task, opts) {
notify('Compiled client files')
}
// export is a reserved keyword for functions
export async function nextbuildstatic (task, opts) {
await task.source(opts.src || 'export/**/*.js').babel().target('dist/export')
notify('Compiled export files')
}
// Create node_modules/next for the use of test apps
export async function symlinkNextForTesting () {
rimraf.sync('test/node_modules/next')
@ -56,6 +62,7 @@ export default async function (task) {
await task.watch('pages/**/*.js', 'copy')
await task.watch('server/**/*.js', 'server')
await task.watch('build/**/*.js', 'nextbuild')
await task.watch('export/**/*.js', 'nextexport')
await task.watch('client/**/*.js', 'client')
await task.watch('lib/**/*.js', 'lib')
}

View file

@ -13,7 +13,7 @@ import fkill from 'fkill'
// The reason we don't import the relative path `../../dist/<etc>` is that it would lead to inconsistent module singletons
import server from 'next/dist/server/next'
import build from 'next/dist/build'
import _export from 'next/dist/server/export'
import _export from 'next/dist/export'
import _pkg from 'next/package.json'
export const nextServer = server