Open ythy opened 3 years ago
{ test: /\.ejs$/, use: { loader: 'ejs-compiled-loader', options: { htmlmin: true, htmlminOptions: { removeComments: true } } } }
new HtmlWebpackPlugin({ title: "hello world", minify: false, filename: "world.jsp", template: "./src/templates/hello_prod.ejs" , chunks: [ 'index' ], }),
### templates 注意这里`<%@ page contentType="text/html; charset=UTF-8" language="java" errorPage="" %>` 需要转义 * hello.ejs * hello_prod.ejs ```ejs <%%@ page contentType="text/html; charset=UTF-8" language="java" errorPage="" %> <%- include hello -%>
补充 ejs documents
依赖
Webpack config
new HtmlWebpackPlugin({ title: "hello world", minify: false, filename: "world.jsp", template: "./src/templates/hello_prod.ejs" , chunks: [ 'index' ], }),