【发布时间】:2017-09-26 05:50:12
【问题描述】:
考虑:
plugins: [
new HtmlWebpackPlugin({
template: 'index.pug',
title: 'Page Title',
custom: 'Custom'
})
]
内部index.pug:
doctype html
html
head
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible" content="IE=edge")
meta(name="viewport" content="width=device-width, initial-scale=1")
title= htmlWebpackPlugin.options.title
我希望自定义标题会被选中,但它会输出默认的Webpack App(而custom 变量是undefined)。
- webpack 1.15.0
- html-web-pack-plugin 2.30.1
- 哈巴狗 2.0.0-rc.4
我在这里束手无策,我觉得我显然错过了一些东西。
【问题讨论】:
-
htmlWebpackPlugin选项仅适用于.ejs文件。 -
@imcvampire 认真的吗?这在某处有记录吗?
-
默认只支持
ejs。但是你可以配置使用另一个加载器
标签: webpack html-webpack-plugin pug-loader