2
Ich versuche, Webpack verwenden, um eine HTML-Seite mit ejs neu zu erstellen. Mit der Konfiguration unten bekomme ich den Fehler.webpack mit dem ejs loader
Module build failed: SyntaxError: Unexpected token .
webpack.config.js
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
context: __dirname + "/src",
entry: ['./pages/index.ejx'],
output: {
path: __dirname + "/dist",
filename: "[name].bundle.js",
chunkFilename: "[id].bundle.js"
},
plugins: [
new HtmlWebpackPlugin({ template: 'pages/index.ejs'})
]
}
index.ejs
<!DOCTYPE html>
<html>
<% include ..partials/head %>
<% include ..partials/body %>
</html>