Skip to content

Javascript minifying is working only in first web load (just after assets folder is deleted) #42

@dantart

Description

@dantart

Hi:
Weird behaviour. I have this config:

            'class' => '\skeeks\yii2\assetsAuto\AssetsAutoCompressComponent',
            'enabled' => true,
            'readFileTimeout' => 3000, //Time in seconds for reading each asset file
            
            'cssCompress' =>                    true, //Enable minification css in html code
            'cssFileCompile' =>                 true, //Turning association css files
            'cssFileRemouteCompile' =>          true, //Trying to get css files to which the specified path as the remote file, skchat him to her.
            'cssFileCompress' =>                false,  //Enable compression and processing before being stored in the css file
            'cssFileBottom' =>                  true, //Moving down the page css files
            'cssFileBottomLoadOnJs' =>          true, //Transfer css file down the page and uploading them using js
                
            'jsCompress' =>                     true, //Enable minification js in html code
            'jsCompressFlaggedComments' =>      true, //Cut comments during processing js
            'jsFileCompile' =>                  true, //Turning association js files
            'jsFileRemouteCompile' =>           true, //Trying to get a js files to which the specified path as the remote file, skchat him to her.
            'jsFileCompress' =>                 false, //Enable compression and processing js before saving a file
            'jsFileCompressFlaggedComments' =>  false, //Cut comments during processing js
            
            'htmlCompress' => true, //Enable compression html
            'htmlCompressOptions' => //options for compressing output result
            [
                'extra' => true, //use more compact algorithm
                'no-comments' => true, //cut all the html comments
            ],
  1. I start the test deleting my assets folder
  2. I load the page and I see that js-compress files are created and in the source code I see just one call to a big js (minified of all my original js)
  3. I reload the page and then I see my dozens of js loaded as minified would have not worked
  4. Just if I delete again the assets folder, then the minified version is created correctly

So, it's just working JUST AFTER deleting the assets folder ... if there's something already created in the folder, it will not minified.

I have tried with other configuration, even turning everything off and just turn on the jsCompress. Same behaviour

Thank you for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions