#StackBounty: #magento-2.1 Magento 2 Use Symlink In Default or Production Mode for Pub Static Files

Bounty: 50

Situation: I am running some free trials of Magento 2 and have limited HD space on the VPS. For this reason to cut down on HD space I want to have Magento symlink the files in default or production mode. I have noticed that a default Magento 2 install is about 420mb once the site first runs it goes to around 770mb so 350mb of this is copied files.

I have modified: app/etc/di.xml line:

 <item name="default" xsi:type="object">MagentoFrameworkAppViewAssetMaterializationStrategyCopy</item>

to

 <item name="default" xsi:type="object">MagentoFrameworkAppViewAssetMaterializationStrategySymlink</item>

This works ok and the site will properly create the symlinks even when in default mode. However the issue is that the css is not created or the js-translation.json the files it should create but does not are:

/pub/static/version1488209436/frontend/Magento/luma/en_US/css/styles-m.css

/pub/static/version1488209436/frontend/Magento/luma/en_US/css/styles-l.css

/pub/static/version1488209436/frontend/Magento/luma/en_US/css/print.css

/pub/static/version1488209436/frontend/Magento/luma/en_US/js-translation.json

So the question is: how do I make Magento also generate these files when in default or production mode and using symlinks?


Get this bounty!!!

Leave a Reply