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([
|
||||
...this.options.build.watch,
|
||||
...Object.values(omit(this.options.build.styleResources, ['options']))
|
||||
]).map(upath.normalizeSafe)
|
||||
]).map(this.nuxt.resolver.resolveAlias).map(upath.normalizeSafe)
|
||||
|
||||
if (customPatterns.length === 0) {
|
||||
return
|
||||
|
@ -178,10 +178,10 @@ describe('builder: builder watch', () => {
|
||||
middleware: '/var/nuxt/src/middleware'
|
||||
}
|
||||
nuxt.options.build.watch = [
|
||||
'/var/nuxt/src/custom'
|
||||
'~/custom'
|
||||
]
|
||||
nuxt.options.build.styleResources = [
|
||||
'/var/nuxt/src/style'
|
||||
'~/style'
|
||||
]
|
||||
const builder = new Builder(nuxt, BundleBuilder)
|
||||
builder.createFileWatcher = jest.fn()
|
||||
@ -189,8 +189,8 @@ describe('builder: builder watch', () => {
|
||||
builder.watchClient()
|
||||
|
||||
const patterns = [
|
||||
'/var/nuxt/src/custom',
|
||||
'/var/nuxt/src/style'
|
||||
'resolveAlias(~/custom)',
|
||||
'resolveAlias(~/style)'
|
||||
]
|
||||
|
||||
expect(builder.createFileWatcher).toBeCalledTimes(3)
|
||||
|
Loading…
Reference in New Issue
Block a user