mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +00:00
26 lines
542 B
TypeScript
26 lines
542 B
TypeScript
import type { WebpackConfigContext } from '../utils/config'
|
|
|
|
export function pug (ctx: WebpackConfigContext) {
|
|
ctx.config.module!.rules!.push({
|
|
test: /\.pug$/i,
|
|
oneOf: [
|
|
{
|
|
resourceQuery: /^\?vue/i,
|
|
use: [{
|
|
loader: 'pug-plain-loader',
|
|
options: ctx.userConfig.loaders.pugPlain
|
|
}]
|
|
},
|
|
{
|
|
use: [
|
|
'raw-loader',
|
|
{
|
|
loader: 'pug-plain-loader',
|
|
options: ctx.userConfig.loaders.pugPlain
|
|
}
|
|
]
|
|
}
|
|
]
|
|
})
|
|
}
|