aspnet / AspNetWebStack

ASP.NET MVC 5.x, Web API 2.x, and Web Pages 3.x (not ASP.NET Core)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error in minified js

DanHampl opened this issue · comments

When I try to minify the following code I get 2 problems.

let alpha: string;
let beta: string;
const foo = () => { return { alpha: "a", beta: "b" }; };
({ alpha, beta } = foo());

let t,i;const r=()=>{alpha:"a",beta:"b"};({alpha:t,beta:i})=r()};

  1. { return { alpha: "a", beta: "b" }; }; translates into r=()=>{alpha:"a",beta:"b"};, which can not be parsed
  2. ({ alpha, beta } = foo()); translates into ({alpha:t,beta:i})=r(), where the last bracket randomly teleports and turns into unparsable code as well

Microsoft.AspNet.Mvc v5.2.7
NetFramework 4.7.2
Microsoft.AspNet.Web.Optimization 1.1.3
Running on up to date Windows 10 pro
IIS 20H2

If you need any other information please let me know, I will be happy to provide it.

commented

Thanks for contacting us.
Unfortunately, the minifier used in that package is no longer being worked on, and likely doesn’t work with the new bootstrap. There is some extensibility you could consider leveraging to try plugging in another minifier, but we recommend switching to build time minification instead of using this package at this point.