diff --git a/lib/builder/webpack/base.js b/lib/builder/webpack/base.js index 8cd6a29406..857c8eefbd 100644 --- a/lib/builder/webpack/base.js +++ b/lib/builder/webpack/base.js @@ -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/, diff --git a/package.json b/package.json index 000681b35e..8c2444a4d4 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/e2e/basic.browser.test.js b/test/e2e/basic.browser.test.js index c285c9e665..9ffea9a6f9 100644 --- a/test/e2e/basic.browser.test.js +++ b/test/e2e/basic.browser.test.js @@ -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') diff --git a/test/fixtures/basic/pages/pug.vue b/test/fixtures/basic/pages/pug.vue new file mode 100644 index 0000000000..f14d525031 --- /dev/null +++ b/test/fixtures/basic/pages/pug.vue @@ -0,0 +1,3 @@ +