mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
feat(generator): add nojekyll option (#8813)
Co-authored-by: Xin Du (Clark) <clark.duxin@gmail.com>
This commit is contained in:
parent
931d1cf89e
commit
380ffb6481
@ -8,6 +8,7 @@ export default () => ({
|
||||
fallback: '200.html',
|
||||
crawler: true,
|
||||
manifest: true,
|
||||
nojekyll: true,
|
||||
cache: {
|
||||
ignore: [],
|
||||
globbyOptions: {
|
||||
|
@ -218,6 +218,7 @@ Object {
|
||||
"fallback": "200.html",
|
||||
"interval": 0,
|
||||
"manifest": true,
|
||||
"nojekyll": true,
|
||||
"routes": Array [],
|
||||
"staticAssets": Object {
|
||||
"base": "/_nuxt/static",
|
||||
|
@ -193,6 +193,7 @@ Object {
|
||||
"fallback": "200.html",
|
||||
"interval": 0,
|
||||
"manifest": true,
|
||||
"nojekyll": true,
|
||||
"routes": Array [],
|
||||
"staticAssets": Object {
|
||||
"base": undefined,
|
||||
@ -578,6 +579,7 @@ Object {
|
||||
"fallback": "200.html",
|
||||
"interval": 0,
|
||||
"manifest": true,
|
||||
"nojekyll": true,
|
||||
"routes": Array [],
|
||||
"staticAssets": Object {
|
||||
"base": undefined,
|
||||
|
@ -267,8 +267,10 @@ export default class Generator {
|
||||
|
||||
// Add .nojekyll file to let GitHub Pages add the _nuxt/ folder
|
||||
// https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/
|
||||
if (this.options.generate.nojekyll) {
|
||||
const nojekyllPath = path.resolve(this.distPath, '.nojekyll')
|
||||
await fsExtra.writeFile(nojekyllPath, '')
|
||||
}
|
||||
|
||||
await this.nuxt.callHook('generate:distCopied', this)
|
||||
await this.nuxt.callHook('export:distCopied', this)
|
||||
|
@ -182,6 +182,7 @@ describe('generator: initialize', () => {
|
||||
test('should initialize destination folder', async () => {
|
||||
const nuxt = createNuxt()
|
||||
nuxt.options.generate.fallback = 'fallback.html'
|
||||
nuxt.options.generate.nojekyll = true
|
||||
const generator = new Generator(nuxt)
|
||||
fsExtra.exists.mockReturnValueOnce(false)
|
||||
|
||||
|
1
packages/types/config/generate.d.ts
vendored
1
packages/types/config/generate.d.ts
vendored
@ -18,6 +18,7 @@ export interface NuxtOptionsGenerate {
|
||||
exclude?: RegExp[]
|
||||
fallback?: string | boolean
|
||||
interval?: number
|
||||
nojekyll?: boolean
|
||||
routes?: NuxtOptionsGenerateRoute[] | NuxtOptionsGenerateRoutesFunction | NuxtOptionsGenerateRoutesFunctionWithCallback
|
||||
subFolders?: boolean
|
||||
cache?: false | {
|
||||
|
Loading…
Reference in New Issue
Block a user