JS代码
const ejs = require("ejs");
ejs.delimiter = '$';
cms.set("view engine","html");
cms.engine("html",ejs.__express);
ejs代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title><$= title $></title>
</head>
<body class="cms-body">
<div id="root">
</div>
</body>
</html>
webpack.config.js
new htmlWebpackPlugin({
filename: path.join(_rootpath, "/views/home.html"),
template: path.join(_rootpath, "/views/template/home.ejs"),
chunks:["vendor","home"],
minify:{
collapseWhitespace:true
}
})
但是页面显示:
Html Webpack Plugin:
Error: Parse Error: <$= title $>
我想知道 HtmlWebpackPlugin 如何跳过解析<$= $>
?