Skip to content
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

Code is generated to load whitespace #16

Closed
0xR opened this issue Mar 13, 2017 · 2 comments
Closed

Code is generated to load whitespace #16

0xR opened this issue Mar 13, 2017 · 2 comments

Comments

@0xR
Copy link
Contributor

0xR commented Mar 13, 2017

Using the webpack analyze tool I discovered that sometimes code like this is generated:

/*__wc__loader*/

(function (document) {
  var _htmlStr = "\n\n\n\n\n\n\n\n\n\n\n\n\n";
  if (document.head) {
    var el = document.head;
    var div = document.createElement('div');
    div.innerHTML = _htmlStr;
    while (div.children.length > 0) {
      el.appendChild(div.children[0]);
    }
  } else {
    document.write(_htmlStr);
  }
})(document);

(function (document) {
  var _htmlStr = "<dom-module ...

This seems unnecessary and not doing this will improve runtime performance and bundle size.

aruntk added a commit that referenced this issue Mar 14, 2017
@aruntk
Copy link
Owner

aruntk commented Mar 14, 2017

@aruntk aruntk closed this as completed Mar 14, 2017
@0xR
Copy link
Contributor Author

0xR commented Mar 14, 2017

That has fixed it, thanks!

Also thanks for adding the html-minify option. I was looking for that earlier and didn't find it. As a workaround I was using html-minify-loader before applying wc-loader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants