html-webpack-plugin: Webpack 2.0.7-beta failing compile
Hi,
I’m having issues compiling with a very basic setup using Webpack 2. Getting two sets of errors ([…] = redacted):
ERROR in Error: Child compilation failed:
Module parse failed: [...]/node_modules/html-webpack-plugin/lib/loader.js! [...]/node_modules/html-webpack-plugin/default_index.ejs Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| <!DOCTYPE html>
| <html>
| <head>:
SyntaxError: Unexpected token (1:0)
- compiler.js:78
[...]/[html-webpack-plugin]/lib/compiler.js:78:16
- Compiler.js:243 Compiler.<anonymous>
[...]/[webpack]/lib/Compiler.js:243:10
- Compiler.js:432
[...]/[webpack]/lib/Compiler.js:432:12
...
and
Child html-webpack-plugin for "index.html":
ERROR in ./~/html-webpack-plugin/lib/loader.js!./~/html-webpack-plugin/default_index.ejs
Module parse failed: [...]/node_modules/html-webpack-plugin/lib/loader.js![...]/node_modules/html-webpack-plugin/default_index.ejs Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| <!DOCTYPE html>
| <html>
| <head>
The config is
context: __dirname + '/app',
entry: { 'app' : './entry' },
output: {
path: __dirname + '/public/assets/[hash]',
publicPath: "/assets/[hash]",
filename: '[name].js'
},
...
devServer: {
contentBase: "./public",
}
...
plugins: [
new HtmlWebpackPlugin()
],
Any ideas?
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 18 (12 by maintainers)
Commits related to this issue
- Fix Webpack2 compatibility. Closes #213. — committed to foglerek/html-webpack-plugin by foglerek 8 years ago
- Fix Webpack2 compatibility. Closes #213. — committed to jantimon/html-webpack-plugin by foglerek 8 years ago
- Merge basic webpack 2 support #225 # By Alexander Wesolowski (1) and Jan Nicklas (1) * commit 'c883a8663c07da04cb6b713bca45ed65a93f7e5c': Move template.js into loader.js Fix Webpack2 compatibilit... — committed to jantimon/html-webpack-plugin by jantimon 8 years ago
Have webpack 2.2.1 and this issue still exists, solution of RahavLussato not working