question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

customAttrAssign issues on Polymer

See original GitHub issue

I’ve tried the following

  var optsHtml = {
    caseSensitive: true,
    customAttrAssign: [/\?=/],
    customAttrSurround: [
        [ /\{\{#if\s+\w+\}\}/, /\{\{\/if\}\}/ ],
        [ /\{\{#unless\s+\w+\}\}/, /\{\{\/unless\}\}/ ]
      ],
    collapseWhitespace: true,
    preserveLineBreaks: true,
    minifyCSS: true,
    // minifyJS: true,
    removeComments: true
  };

However, the customAttrAssign and customAttrSurround seem to be causing issues.

I copied the values directly from the minifier.js test code. Any advice on what I may have done wrong?

This is the error that I’m getting:

events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: Parse Error: <div id="checkbox" class$="[[_computeCheckboxClass(checked, invalid)]]">
        <div id="checkmark" class$="[[_computeCheckmarkClass(checked)]]"></div>
      </div>
    </div>

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
cpboydcommented, Dec 15, 2015

I added /\$=/ to the customAttrAssign, but the resulting file from html-minifier ends up having the style$ value stripped.

e.g. <div id="drawer" style$="[[_computeDrawerStyle(drawerWidth)]]"> becomes: <div id="drawer" style$="">

0reactions
cpboydcommented, Feb 12, 2016

@alexlamsl As an aside: gulp-minify-inline allows a cssSelector. Specifying style[is!="custom-style"] allows it to ignore the Polymer-specific CSS and apply to the rest.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - customAttrAssign issues on Polymer - - Bountysource
I've tried the following var optsHtml = { caseSensitive: true, customAttrAssign: [/\?=/], customAttrSurround: [ [ /\{\{#if\s+\w+\}\}/, /\{\{\/if\}\}/ ] ...
Read more >
Polymer: vulcanizing/minifying site breaks it in Firefox
I have a custom build process for a Polymer site (Polybuild kept ... a function localhost:3000:1:2359 <snip repeated desugarBehaviors error>.
Read more >
wc-loader - npm Package Health Analysis | Snyk
wc-loader helps you use webcomponents (polymer, x-tags etc also) with webpack. ... A total of 3 vulnerabilities or license issues were detected.
Read more >
Build for production - Polymer Project
According to the native Custom Elements V1 spec, elements must be defined using ES6 classes. ES5-defined elements will error in the presence of...
Read more >
Booting up with polymer - SlideShare
Slides for presentation at SeaJUG on 3/15/16.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found