mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
feat(builder): followSymlinks
option to allow for symlinks (#6368)
This commit is contained in:
parent
d1df5c8124
commit
92c7f4ed24
@ -310,7 +310,8 @@ export default class Builder {
|
||||
async resolveFiles (dir, cwd = this.options.srcDir) {
|
||||
return this.ignore.filter(await glob(this.globPathWithExtensions(dir), {
|
||||
cwd,
|
||||
ignore: this.options.ignore
|
||||
ignore: this.options.ignore,
|
||||
follow: this.options.build.followSymlinks
|
||||
}))
|
||||
}
|
||||
|
||||
|
@ -118,5 +118,6 @@ export default () => ({
|
||||
},
|
||||
friendlyErrors: true,
|
||||
additionalExtensions: [],
|
||||
warningIgnoreFilters: []
|
||||
warningIgnoreFilters: [],
|
||||
followSymlinks: false
|
||||
})
|
||||
|
@ -39,6 +39,7 @@ Object {
|
||||
"img": [Function],
|
||||
"video": [Function],
|
||||
},
|
||||
"followSymlinks": false,
|
||||
"friendlyErrors": true,
|
||||
"hardSource": false,
|
||||
"hotMiddleware": Object {},
|
||||
|
@ -26,6 +26,7 @@ Object {
|
||||
"img": [Function],
|
||||
"video": [Function],
|
||||
},
|
||||
"followSymlinks": false,
|
||||
"friendlyErrors": true,
|
||||
"hardSource": false,
|
||||
"hotMiddleware": Object {},
|
||||
@ -376,6 +377,7 @@ Object {
|
||||
"img": [Function],
|
||||
"video": [Function],
|
||||
},
|
||||
"followSymlinks": false,
|
||||
"friendlyErrors": true,
|
||||
"hardSource": false,
|
||||
"hotMiddleware": Object {},
|
||||
|
1
test/fixtures/basic/nuxt.config.js
vendored
1
test/fixtures/basic/nuxt.config.js
vendored
@ -77,6 +77,7 @@ export default {
|
||||
build: {
|
||||
scopeHoisting: true,
|
||||
publicPath: '',
|
||||
followSymlinks: true,
|
||||
postcss: {
|
||||
preset: {
|
||||
features: {
|
||||
|
3
test/fixtures/basic/pages/symlink/deep/nested-symlinked.vue
vendored
Normal file
3
test/fixtures/basic/pages/symlink/deep/nested-symlinked.vue
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<h1>Nested symlink page</h1>
|
||||
</template>
|
3
test/fixtures/basic/pages/symlink/symlinked.vue
vendored
Normal file
3
test/fixtures/basic/pages/symlink/symlinked.vue
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<h1>Symlinked page</h1>
|
||||
</template>
|
3
test/fixtures/basic/pages2/deep/nested-symlinked.vue
vendored
Normal file
3
test/fixtures/basic/pages2/deep/nested-symlinked.vue
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<h1>Nested symlink page</h1>
|
||||
</template>
|
3
test/fixtures/basic/pages2/symlinked.vue
vendored
Normal file
3
test/fixtures/basic/pages2/symlinked.vue
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
<template>
|
||||
<h1>Symlinked page</h1>
|
||||
</template>
|
@ -358,6 +358,16 @@ describe('basic ssr', () => {
|
||||
expect(html).toMatch('<h1>JS Layout</h1>')
|
||||
expect(html).toMatch('<h2>custom page</h2>')
|
||||
})
|
||||
/* Testing symlinks functionality */
|
||||
test('/symlink/symlinked', async () => {
|
||||
const { html } = await nuxt.server.renderRoute('/symlink/symlinked')
|
||||
expect(html).toContain('<h1>Symlinked page</h1>')
|
||||
})
|
||||
|
||||
test('/symlink/deep/nested-symlinked', async () => {
|
||||
const { html } = await nuxt.server.renderRoute('/symlink/deep/nested-symlinked')
|
||||
expect(html).toContain('<h1>Nested symlink page</h1>')
|
||||
})
|
||||
|
||||
// Close server and ask nuxt to stop listening to file changes
|
||||
afterAll(async () => {
|
||||
|
Loading…
Reference in New Issue
Block a user