Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[AssetMapper] Support minifying JS/CSS/SVG/etc #54907

Closed
@cavias

Description

@cavias

Description

Hello there!

I quite like the idea of AssetMapper, but...

I am working on an old PHP monolith with multiple mbs of JS and CSS. We are in the process of porting this app to Symfony and optimising it. As part of this I did some testing with AssetMapper, and though it works great, I've ran into an issue with not being able to minify the JS/CSS.

The problem I am facing specifically is that for us there is a very significant file and performance difference between the minified and non-minified versions of the JS we're serving. That is with gzip compression.

Numbers
On average, depending on the file, the difference is about 25% in terms of file size. And Google Lighthouse does start to yell at me to minify the JS.

Our main JS file has a 50kb difference WITH compression between minifying and not minifying - without compression that would be about 280kb. And that main JS file only represents 1/6 of the total JS in the app spread through various pages.

Also Lighthouse dropped us 15 points instantly.

So I was wondering, can we get an implementation for minification of JS and CSS?

For CSS I can't do any real in-app testing atm, because we use a custom compiler for that to inject values into placeholders - we want to replace that with something else like AssetMapper or webpack or Vite in the future as well.


DISCLAIMER
Yes, I know our JS needs optimising, but I can't really do this in a few days. It's a work in progress, but that'll take time. Right now, for my usecase, and I imagine for other people's as well, being able to minify would solve our issue while allowing us to sort out our JS with the help of AssetMapper.


TL;DR: Can we get minification of JS/CSS and other things supported in AssetMapper?

Example

Something likehttps://github.com/WebGardenGroup/minify-bundle which runs onhttps://github.com/tdewolff/minify

But with more official and guaranteerd support.

Update 27-05-24

We (as a company) currently are implementing Vite usinghttps://symfony-vite.pentatrion.com/

Although I am not a fan of using more 3rd party bundles because of various risks, it does work really well.

Part of the reason we choose Vite over Webpack is that it is becoming the company-wide standard (so we have in-house experts). This will also simplify sharing (Vue/SCSS) assets between our projects, which is a desire by many here. On top of that, many people here are of the opinion that Vite = harder/better/faster/stronger > Webpack.

I do hope the discussion about implementing some kind of minifying+uglifying in AssetMapper will continue, as I am convinced it will be a very important requirement for many others to switch over.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp