-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
js&css cannot be injected into the HTML file @version 2 #135
Comments
Is this a duplicate of #128 ? |
I checked the #128 issue before submit this one,and it's not the same. So the new version is worked in your project?Or I missed something important? |
@xiaoyunchen could you please try if it works now? |
Oh thanks for the bug report could you please show me the source of ./src/view/index.html ? |
Yes,it's so simple: <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Index主页</title>
<meta name="author" content="https://github.com/xiaoyunchen/webpack"/>
<meta name="date" content="2015-12-3"/>
<meta name="description" content="for test"/>
<!--
comments here
-->
</head>
<body>
<p>
<button id="btn">Add</button>
</p>
<!--
another comment and should be removed
-->
</body>
</html> |
From: https://github.com/ampedandwired/html-webpack-plugin/tree/feature/loaders/examples/html-loader <!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example template</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<img src="logo.png">
</body>
</html> Now if you add the Uglify plugin the html-loader uses aggressive minfification: <!DOCTYPE html><html lang=en><head><meta charset=utf-8><title>Example template</title><meta name=viewport content="width=device-width,initial-scale=1"><body><img src=0714810ae3fb211173e2964249507195.png> As you can see it removes ALL closing html tags. |
Yes,without the ending tags of html/body/head |
There is already an issue for that: webpack-contrib/html-loader#40 and a pull request: |
For now you can disable { test: /\.html$/, loader: 'html-loader?-removeOptionalTags' }, |
OK,Thx for that and I will try this |
the CSS cannot be injected either even disable removeOptionalTags option |
Please see the examples folder :) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
this is my config:
the same config file,If I use the version 1.7,it works!
But when I update to version 2,js&css cannot be injected into the HTML file,and even more, collapseWhitespace option in the minify option is not works neither.please check it and thanks.
The text was updated successfully, but these errors were encountered: