-
-
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
using es6 template string break the html file build #950
Comments
Thanks for reporting this issue - could you please add a https://github.com/jantimon/html-webpack-plugin/blob/master/index.js#L245 |
it's a pretty long output and I guess what you need is The output is (function(module, exports, __webpack_require__) {
var _ = __webpack_require__(2);module.exports = function (templateParams) { with(templateParams) {return (function(data) {
var __t, __p = '';
__p += '<!DOCTYPE html>\n<html lang="en">\n\n<head>\n <meta charset="UTF-8">\n <title>\n ' +
((__t = ( htmlWebpackPlugin.options.title )) == null ? '' : __t) +
'\n </title>\n <script>\n const hello = \'hello\';\n const world = \'world\'\n console.log(`' +
((__t = (hello)) == null ? '' : __t) +
' ' +
((__t = (world)) == null ? '' : __t) +
'`); // ~this line~\n </script>\n</head>\n\n<body>\n <div id="app"></div>\n \n</body>\n\n</html>\n';
return __p
})();}}
}) em... seems it unexpectedly processes ES6 template strings as same as |
Nice 👍 thanks for analyzing. html-webpack-plugin/lib/loader.js Line 28 in b4312f9
Do you have any idea what might be the reason? |
Only transpile EJS style `<%= name %>`, Close jantimon#950
I've find a lodash issue here lodash/lodash#399 (comment) solution could be simply add a default html-webpack-plugin/lib/loader.js Line 28 in b4312f9
|
BTW, Although in all docs it doesn't encourage users to use I suggest a semver-minor change and document it on top of changelog and readme |
Hey @tommytroylin |
Only transpile EJS style `<%= name %>`, Close #950
Only transpile EJS style `<%= name %>`, Close #950 BREAKING CHANGE: Template strings inside templates are now disabled by default
Only transpile EJS style `<%= name %>`, Close #950 BREAKING CHANGE: Template strings inside templates are now disabled by default
Only transpile EJS style `<%= name %>`, Close #950 BREAKING CHANGE: Template strings inside templates are now disabled by default
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. |
Description
This may be something related when html-webpack-html processing html template with lodash/template.
https://github.com/jantimon/html-webpack-plugin/blob/master/lib/loader.js#L30-L34
Error Message & Stack Trace
Config
Copy the relevant section from
webpack.config.js
:Copy your template file:
Environment
The text was updated successfully, but these errors were encountered: