madskristensen / BundlerMinifier

Visual Studio extension
Other
614 stars 172 forks source link

Error parsing tagged template literals #249

Open wegylexy opened 7 years ago

wegylexy commented 7 years ago

Installed product versions

Description

Error parsing source with template literal tags

Steps to recreate

  1. Create a *.js that contains a tagged template literal and the corresponding tag function
    
    function tagFunction(template, ...args) {
        ...
    }
    let arg0, arg1;
    let untagged = `some ${arg0} and ${arg1}, etc.`; // OK
    let tagged = tagFunction`some ${arg0} and ${arg1}, etc.`; // Expected ";"
  2. Attempt to minify it

Current behavior

It currently treats the template literal tag as one token, complaining the template that follows the tag is unexpected.

Expected behavior

Minify the template as usual, and keep the tag in front of the template; update the tag if the tag function name is also minified.

flatproject commented 6 years ago

Same problem here. Template literals not working on IE 11 breaking the whole bundled/minified scripts. Surprised you haven't received a single reply since March. We are probably the only ones using template literals.... How are other people dealing with this issue? Get rid of this bundler/minifier and use something like BabelJS? Have you resolved it yourself?

wegylexy commented 6 years ago

TypeScript compiler already bundles my scripts, just hoping they can be properly minified soon.