neilime / zf2-assets-bundle

AssetsBundle is a module for Zend Framework 2 allowing asset managment (bundling & caching)
https://neilime.github.io/zf2-assets-bundle/
MIT License
33 stars 20 forks source link

How can I prevent merge JS file #50

Closed justinphan1992 closed 5 years ago

justinphan1992 commented 7 years ago

Hi neilime.

Thank you to create nice tool to mannage the asset files. I have problem when turn on production mode the javascript file occurred error. Is there any way to turn off merge files just in javascript

neilime commented 7 years ago

There's no way to turn off mergin files for javascript at the moment. Maybe you can try to use an another javascript filter :

array(
    'assets_bundle' => array(
        'filters' => array(
            \AssetsBundle\AssetFile\AssetFile::ASSET_JS => 'JsMinAssetFileFilter',
        ),
    ),
);

Tell me if it works for you

justinphan1992 commented 7 years ago

Thank for your response

I tried but didnt work.

neilime commented 7 years ago

Or you can try to disable the JavaScript filter :

array(
    'assets_bundle' => array(
        'filters' => array(
            \AssetsBundle\AssetFile\AssetFile::ASSET_JS => new \Zend\Stdlib\ArrayUtils\MergeRemoveKey(),
        ),
    ),
);
neilime commented 7 years ago

Have you tried the previous solution ?