Skip to content

Commit 6252887

Browse files
authored
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
1 parent c44dab6 commit 6252887

File tree

22 files changed

+12
-5
lines changed

22 files changed

+12
-5
lines changed

bin/next-export

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { resolve, join } from 'path'
33
import { existsSync } from 'fs'
44
import parseArgs from 'minimist'
5-
import exportApp from '../server/export'
5+
import exportApp from '../export'
66
import { printAndExit } from '../lib/utils'
77

88
const argv = parseArgs(process.argv.slice(2), {

server/export.js renamed to export/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import cp from 'recursive-copy'
33
import mkdirp from 'mkdirp-then'
44
import { extname, resolve, join, dirname, sep } from 'path'
55
import { existsSync, readFileSync, writeFileSync } from 'fs'
6-
import loadConfig from './config'
6+
import loadConfig from '../server/config'
77
import {PHASE_EXPORT, SERVER_DIRECTORY, PAGES_MANIFEST, CONFIG_FILE, BUILD_ID_FILE, CLIENT_STATIC_FILES_PATH} from '../lib/constants'
8-
import { renderToHTML } from './render'
8+
import { renderToHTML } from '../server/render'
99
import { setAssetPrefix } from '../lib/asset'
1010
import * as envConfig from '../lib/runtime-config'
1111

taskfile.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const mkdirp = require('mkdirp')
55
const isWindows = /^win/.test(process.platform)
66

77
export async function compile (task) {
8-
await task.parallel(['bin', 'server', 'nextbuild', 'lib', 'client'])
8+
await task.parallel(['bin', 'server', 'nextbuild', 'nextbuildstatic', 'lib', 'client'])
99
}
1010

1111
export async function bin (task, opts) {
@@ -33,6 +33,12 @@ export async function client (task, opts) {
3333
notify('Compiled client files')
3434
}
3535

36+
// export is a reserved keyword for functions
37+
export async function nextbuildstatic (task, opts) {
38+
await task.source(opts.src || 'export/**/*.js').babel().target('dist/export')
39+
notify('Compiled export files')
40+
}
41+
3642
// Create node_modules/next for the use of test apps
3743
export async function symlinkNextForTesting () {
3844
rimraf.sync('test/node_modules/next')
@@ -56,6 +62,7 @@ export default async function (task) {
5662
await task.watch('pages/**/*.js', 'copy')
5763
await task.watch('server/**/*.js', 'server')
5864
await task.watch('build/**/*.js', 'nextbuild')
65+
await task.watch('export/**/*.js', 'nextexport')
5966
await task.watch('client/**/*.js', 'client')
6067
await task.watch('lib/**/*.js', 'lib')
6168
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)