BundlerMinifier icon indicating copy to clipboard operation
BundlerMinifier copied to clipboard

Minify Fails with modern syntax

Open Gruski opened this issue 3 years ago • 18 comments

Running latest build: v3.2.463 Javascript minifier fails the entire file if it finds valid constructs like this:

let test = { 
    foo() {
        // do stuff    
    }
}

or this

class Test {
    foo = 'foo';
}

Gruski avatar Feb 18 '21 18:02 Gruski

The first problem was fixed with Nuglify v1.13.6, however still fails on the Class example.

Gruski avatar Mar 18 '21 07:03 Gruski

Are there any plans to address this issue? ES2015 / ES6 are having very good support at the moment. Its a shame that one of the fundamental extension for bundling in .net core does not handle modern syntax.

it-xtech-dev avatar Apr 11 '21 22:04 it-xtech-dev

@it-xtech-dev I agree with you but this extension directly relies on the Nuglify minifier and that's where the lack of ES6 support lies. The best this extension can do is make sure it always stays up to date with latest Nuglify version. Might be a good idea to raise the issue with the Nuglify project. https://github.com/trullock/NUglify/issues/235

Gruski avatar Apr 12 '21 18:04 Gruski

This project not using the latest NUglify is an eternal problem. Please solve this.

Re trullock/NUglify#235 PRs and assistance are very welcome

trullock avatar Apr 29 '21 06:04 trullock

Nuglify just fixed this problem. Can someone please release a new plugin version with the new Nuglify lib?

Gruski avatar Aug 18 '21 17:08 Gruski

I'm trying to set up my Blazorise library to use this extension and I'm stuck on this problem. Any chance this could be addressed soon?

stsrki avatar Nov 13 '21 17:11 stsrki

There needs to be some automation to auto build when Nuglify updates library. This plugin includes a very old version of Nuglify which has fixed all of the issues above.

If I were to replace the lib in here "C:\Users<user>\AppData\Local\Microsoft\VisualStudio\16.0_1b0c3e32\Extensions<RandomGenFolderName>\NUglify.dll" with the new lib would it break the plugin?

Gruski avatar Nov 14 '21 07:11 Gruski

Or just update the dependency reference to be bound to a major version only instead of a revision, then it will happen automatically

trullock avatar Nov 14 '21 07:11 trullock

There are no breaking API changes between the NUglify versions, but your solution will only work locally.

And assembly binding redirect should work.

trullock avatar Nov 14 '21 07:11 trullock

Or just update the dependency reference to be bound to a major version only instead of a revision, then it will happen automatically

How do I do that? Is that in the code and have to recompile plugin?

Gruski avatar Nov 15 '21 01:11 Gruski

There are no breaking API changes between the NUglify versions, but your solution will only work locally.

And assembly binding redirect should work.

"Will only work locally"? As oppose to what? Isn't this plugin always running locally?

Gruski avatar Nov 15 '21 02:11 Gruski

There are no breaking API changes between the NUglify versions, but your solution will only work locally. And assembly binding redirect should work.

"Will only work locally"? As oppose to what? Isn't this plugin always running locally?

If you work in a team then everyone would need to set up the same workaround. Not ideal...

stsrki avatar Nov 15 '21 09:11 stsrki

There are no breaking API changes between the NUglify versions, but your solution will only work locally. And assembly binding redirect should work.

"Will only work locally"? As oppose to what? Isn't this plugin always running locally?

If you work in a team then everyone would need to set up the same workaround. Not ideal...

I work by myself but don't understand the workaround. What do I have to do exactly in simple terms?

Gruski avatar Oct 05 '22 18:10 Gruski

Read how to do an assembly binding redirect

In .NET Framework you add a line to the config which says remap version X of assembly Y to version Z Then reference the latest nuglify and it tricks bundlerminifier I to working

trullock avatar Oct 05 '22 18:10 trullock

Read how to do an assembly binding redirect

In .NET Framework you add a line to the config which says remap version X of assembly Y to version Z Then reference the latest nuglify and it tricks bundlerminifier I to working

So I have to recompile the project then. I am just a user of the app and don't want to get into the code and recompile. There is no other way?

Gruski avatar Oct 05 '22 21:10 Gruski

No you add the redirect to your project, no recompilation needed

On Wed, 5 Oct 2022, 22:21 Gruski, @.***> wrote:

Read how to do an assembly binding redirect

In .NET Framework you add a line to the config which says remap version X of assembly Y to version Z Then reference the latest nuglify and it tricks bundlerminifier I to working

So I have to recompile the project then. I am just a user of the app and don't want to get into the code and recompile. There is no other way?

— Reply to this email directly, view it on GitHub https://github.com/madskristensen/BundlerMinifier/issues/537#issuecomment-1268989859, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA5AXW6DXBCSMSUB2Y2DH3WBXWL5ANCNFSM4X2ZLQQA . You are receiving this because you commented.Message ID: @.***>

trullock avatar Oct 05 '22 21:10 trullock

My project being what, the BundlerMinifier project or the project using the VS BundlerMinifier plugin to minify?

Gruski avatar Oct 06 '22 18:10 Gruski

The latter. See this https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/bindingredirect-element for Framework, not sure what the Core equivalent is

trullock avatar Oct 06 '22 20:10 trullock