Templates 当icluding partial因意外标识符而失败时,带有ejs的webpack4
我在webpack4下使用ejs进行模板制作,并定义了一个入口点,如Templates 当icluding partial因意外标识符而失败时,带有ejs的webpack4,templates,include,ejs,webpack-4,Templates,Include,Ejs,Webpack 4,我在webpack4下使用ejs进行模板制作,并定义了一个入口点,如 new HtmlWebpackPlugin({ template: './src/views/index.ejs', debug: true, files: { css: ['main.css'], js : ['bundle.js']
new HtmlWebpackPlugin({
template: './src/views/index.ejs',
debug: true,
files: {
css: ['main.css'],
js : ['bundle.js']
},
})
现在在index.ejs
中,我尝试包含一个类似如下的部分
<% include partials/footer %>
我曾试图用谷歌搜索类似的问题,但在我的案例中没有一个是有效的
ERROR in ./src/views/index.ejs (./node_modules/html-webpack-plugin/lib/loader.js!./src/views/index.ejs)
Module build failed (from ./node_modules/html-webpack-plugin/lib/loader.js):
SyntaxError: Unexpected identifier