analog icon indicating copy to clipboard operation
analog copied to clipboard

chore: add perf changes from esbuild browser plugin

Open brandonroberts opened this issue 1 year ago • 3 comments

Adds checks to see if babel transform is needed

https://github.com/angular/angular-cli/pull/23682

brandonroberts avatar Aug 05 '22 13:08 brandonroberts

I'm unsure where the change that starts on line 371 of that PR should be added in Analog. My guess is in the object whose name is name: '@analogjs/vite-plugin-angular-optimizer' in the angular-vite-plugin.ts file, inside the transform method?

pjlamb12 avatar Aug 11 '22 03:08 pjlamb12

These are the changes I've begun making. I haven't worked with esbuild (or anything similar) before so I know this may need to change.

pjlamb12 avatar Aug 11 '22 03:08 pjlamb12

@pjlamb12 Thanks! Looking on track so far. You don't need to add the advancedOptimizations flag. Just use the isProd boolean that already exists inside the plugin. These changes would be added to both the @analogjs/vite-plugin-angular-optimizer and @analogjs/vite-plugin-angular transform functions.

Would be cleaner to separate the plugins into different files, but that can come as a separate effort.

brandonroberts avatar Aug 11 '22 12:08 brandonroberts