mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-04 03:17:14 +00:00
remove SSR related files from generate artifacts
This commit is contained in:
parent
c5a5dac627
commit
fbb6833400
@ -1,5 +1,4 @@
|
||||
import fs from 'fs'
|
||||
import { copy, remove, writeFile, mkdirp } from 'fs-extra'
|
||||
import { copy, remove, writeFile, mkdirp, removeSync, existsSync } from 'fs-extra'
|
||||
import _ from 'lodash'
|
||||
import { resolve, join, dirname, sep } from 'path'
|
||||
import { minify } from 'html-minifier'
|
||||
@ -99,7 +98,7 @@ export default class Generator extends Tapable {
|
||||
|
||||
// Copy static and built files
|
||||
/* istanbul ignore if */
|
||||
if (fs.existsSync(this.generateRoutes)) {
|
||||
if (existsSync(this.generateRoutes)) {
|
||||
await copy(this.generateRoutes, this.distPath)
|
||||
}
|
||||
await copy(this.srcBuiltPath, this.distNuxtPath)
|
||||
@ -109,6 +108,20 @@ export default class Generator extends Tapable {
|
||||
const nojekyllPath = resolve(this.distPath, '.nojekyll')
|
||||
writeFile(nojekyllPath, '')
|
||||
|
||||
// Cleanup SSR related files
|
||||
const extraFiles = [
|
||||
'index.spa.html',
|
||||
'index.ssr.html',
|
||||
'server-bundle.json',
|
||||
'vue-ssr-client-manifest.json'
|
||||
].map(file => resolve(this.distNuxtPath, file))
|
||||
|
||||
extraFiles.forEach(file => {
|
||||
if (existsSync(file)) {
|
||||
removeSync(file)
|
||||
}
|
||||
})
|
||||
|
||||
debug('Static & build files copied')
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user