mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
fix(builder): resolve aliases in build.watch
paths (#9153)
This commit is contained in:
parent
8ebb92a9f6
commit
9f6131edd3
@ -661,7 +661,7 @@ export default class Builder {
|
|||||||
const customPatterns = uniq([
|
const customPatterns = uniq([
|
||||||
...this.options.build.watch,
|
...this.options.build.watch,
|
||||||
...Object.values(omit(this.options.build.styleResources, ['options']))
|
...Object.values(omit(this.options.build.styleResources, ['options']))
|
||||||
]).map(upath.normalizeSafe)
|
]).map(this.nuxt.resolver.resolveAlias).map(upath.normalizeSafe)
|
||||||
|
|
||||||
if (customPatterns.length === 0) {
|
if (customPatterns.length === 0) {
|
||||||
return
|
return
|
||||||
|
@ -178,10 +178,10 @@ describe('builder: builder watch', () => {
|
|||||||
middleware: '/var/nuxt/src/middleware'
|
middleware: '/var/nuxt/src/middleware'
|
||||||
}
|
}
|
||||||
nuxt.options.build.watch = [
|
nuxt.options.build.watch = [
|
||||||
'/var/nuxt/src/custom'
|
'~/custom'
|
||||||
]
|
]
|
||||||
nuxt.options.build.styleResources = [
|
nuxt.options.build.styleResources = [
|
||||||
'/var/nuxt/src/style'
|
'~/style'
|
||||||
]
|
]
|
||||||
const builder = new Builder(nuxt, BundleBuilder)
|
const builder = new Builder(nuxt, BundleBuilder)
|
||||||
builder.createFileWatcher = jest.fn()
|
builder.createFileWatcher = jest.fn()
|
||||||
@ -189,8 +189,8 @@ describe('builder: builder watch', () => {
|
|||||||
builder.watchClient()
|
builder.watchClient()
|
||||||
|
|
||||||
const patterns = [
|
const patterns = [
|
||||||
'/var/nuxt/src/custom',
|
'resolveAlias(~/custom)',
|
||||||
'/var/nuxt/src/style'
|
'resolveAlias(~/style)'
|
||||||
]
|
]
|
||||||
|
|
||||||
expect(builder.createFileWatcher).toBeCalledTimes(3)
|
expect(builder.createFileWatcher).toBeCalledTimes(3)
|
||||||
|
Loading…
Reference in New Issue
Block a user