mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
feat: optional pug support (#3206)
This commit is contained in:
parent
3d8f51b8c9
commit
85cfc625ee
@ -125,6 +125,18 @@ export default class WebpackBaseConfig {
|
|||||||
}
|
}
|
||||||
}, this.options.build.vueLoader)
|
}, this.options.build.vueLoader)
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
test: /\.pug$/,
|
||||||
|
oneOf: [
|
||||||
|
{
|
||||||
|
resourceQuery: /^\?vue/,
|
||||||
|
use: ['pug-plain-loader']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
use: ['raw-loader', 'pug-plain-loader']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
test: /\.jsx?$/,
|
test: /\.jsx?$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
|
@ -152,6 +152,8 @@
|
|||||||
"jest": "^22.4.3",
|
"jest": "^22.4.3",
|
||||||
"jsdom": "^11.8.0",
|
"jsdom": "^11.8.0",
|
||||||
"nsp": "^3.2.1",
|
"nsp": "^3.2.1",
|
||||||
|
"pug": "^2.0.3",
|
||||||
|
"pug-plain-loader": "^1.0.0",
|
||||||
"puppeteer": "^1.2.0",
|
"puppeteer": "^1.2.0",
|
||||||
"request": "^2.83.0",
|
"request": "^2.83.0",
|
||||||
"request-promise-native": "^1.0.5",
|
"request-promise-native": "^1.0.5",
|
||||||
|
@ -159,6 +159,12 @@ describe('basic browser', () => {
|
|||||||
expect(await page.$text('h1')).toBe('Displayed only on client-side')
|
expect(await page.$text('h1')).toBe('Displayed only on client-side')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('/pug', async () => {
|
||||||
|
await page.nuxt.navigate('/pug')
|
||||||
|
|
||||||
|
expect(await page.$text('h1')).toBe('Pug page')
|
||||||
|
})
|
||||||
|
|
||||||
test('/meta', async () => {
|
test('/meta', async () => {
|
||||||
await page.nuxt.navigate('/meta')
|
await page.nuxt.navigate('/meta')
|
||||||
|
|
||||||
|
3
test/fixtures/basic/pages/pug.vue
vendored
Normal file
3
test/fixtures/basic/pages/pug.vue
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<template lang="pug">
|
||||||
|
h1 Pug page
|
||||||
|
</template>
|
Loading…
Reference in New Issue
Block a user