Nuxt/packages/webpack/src/presets/pug.ts

26 lines
545 B
TypeScript
Raw Normal View History

2020-09-02 12:27:27 +00:00
import { 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.options.webpack.loaders.pugPlain
2020-09-02 12:27:27 +00:00
}]
},
{
use: [
'raw-loader',
{
loader: 'pug-plain-loader',
options: ctx.options.webpack.loaders.pugPlain
2020-09-02 12:27:27 +00:00
}
]
}
]
})
}