2022-12-11 21:44:52 +00:00
|
|
|
import type { WebpackConfigContext } from '../utils/config'
|
2020-09-02 12:27:27 +00:00
|
|
|
|
|
|
|
export function pug (ctx: WebpackConfigContext) {
|
2022-08-26 15:47:29 +00:00
|
|
|
ctx.config.module!.rules!.push({
|
2020-09-02 12:27:27 +00:00
|
|
|
test: /\.pug$/i,
|
|
|
|
oneOf: [
|
|
|
|
{
|
|
|
|
resourceQuery: /^\?vue/i,
|
|
|
|
use: [{
|
|
|
|
loader: 'pug-plain-loader',
|
2023-07-24 19:46:09 +00:00
|
|
|
options: ctx.userConfig.loaders.pugPlain
|
2020-09-02 12:27:27 +00:00
|
|
|
}]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
use: [
|
|
|
|
'raw-loader',
|
|
|
|
{
|
|
|
|
loader: 'pug-plain-loader',
|
2023-07-24 19:46:09 +00:00
|
|
|
options: ctx.userConfig.loaders.pugPlain
|
2020-09-02 12:27:27 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
})
|
|
|
|
}
|