mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
Update transpile to return the opposite of exclude
This commit is contained in:
parent
13ae634c74
commit
f275fc8069
@ -21,7 +21,7 @@ describe('basic dev', () => {
|
|||||||
extend({ module: { rules } }, { isClient }) {
|
extend({ module: { rules } }, { isClient }) {
|
||||||
if (isClient) {
|
if (isClient) {
|
||||||
const babelLoader = rules.find(loader => loader.test.test('.jsx'))
|
const babelLoader = rules.find(loader => loader.test.test('.jsx'))
|
||||||
transpile = babelLoader.exclude
|
transpile = (file) => !babelLoader.exclude(file)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -34,10 +34,10 @@ describe('basic dev', () => {
|
|||||||
|
|
||||||
test('Config: build.transpile', async () => {
|
test('Config: build.transpile', async () => {
|
||||||
expect(transpile('vue-test')).toBeUndefined()
|
expect(transpile('vue-test')).toBeUndefined()
|
||||||
expect(transpile('node_modules/test.js')).toBe(true)
|
expect(transpile('node_modules/test.js')).toBe(false)
|
||||||
expect(transpile('node_modules/vue-test')).toBe(false)
|
expect(transpile('node_modules/vue-test')).toBe(true)
|
||||||
expect(transpile('node_modules/vue.test.js')).toBe(false)
|
expect(transpile('node_modules/vue.test.js')).toBe(true)
|
||||||
expect(transpile('node_modules/test.vue.js')).toBe(false)
|
expect(transpile('node_modules/test.vue.js')).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
test('/stateless', async () => {
|
test('/stateless', async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user