feat: optional pug support (#3206)

This commit is contained in:
Alexandre Villeneuve 2018-04-21 03:27:48 -04:00 committed by Pooya Parsa
parent 3d8f51b8c9
commit 85cfc625ee
4 changed files with 23 additions and 0 deletions

View File

@ -125,6 +125,18 @@ export default class WebpackBaseConfig {
}
}, this.options.build.vueLoader)
},
{
test: /\.pug$/,
oneOf: [
{
resourceQuery: /^\?vue/,
use: ['pug-plain-loader']
},
{
use: ['raw-loader', 'pug-plain-loader']
}
]
},
{
test: /\.jsx?$/,
exclude: /node_modules/,

View File

@ -152,6 +152,8 @@
"jest": "^22.4.3",
"jsdom": "^11.8.0",
"nsp": "^3.2.1",
"pug": "^2.0.3",
"pug-plain-loader": "^1.0.0",
"puppeteer": "^1.2.0",
"request": "^2.83.0",
"request-promise-native": "^1.0.5",

View File

@ -159,6 +159,12 @@ describe('basic browser', () => {
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 () => {
await page.nuxt.navigate('/meta')

3
test/fixtures/basic/pages/pug.vue vendored Normal file
View File

@ -0,0 +1,3 @@
<template lang="pug">
h1 Pug page
</template>