Spea / SpBowerBundle

Symfony2 Bundle to handle asset dependencies with bower
231 stars 44 forks source link

Deploying on a server without bower #121

Open christheyounger opened 9 years ago

christheyounger commented 9 years ago

My host doesn't have node.js. I simply dump assets locally (where i have node, bower, grunt, etc) and push the finished product up (a combined and minified js file).

I thought it would work well to push up only the compiled, minified js file to the production server where only the production version of Symfony is executed - except that when I run the application on the production server - I get a 503, because the source js / css files were not found.

{% javascripts output="js/scripts.min.js" filter="?uglifyjs"
'@MyBundle/Resources/src/js/jquery.js'
'@MyBundle/Resources/src/js/bootstrap.js'
'@MyBundle/Resources/src/js/site.js' %}
<script src="{{asset_url}}"></script>
{% endjavascripts %}

In the end I've had to also upload all the source files so that Symfony can check that they are there, and then ignore them and use the compiled version.

Am I going about this the wrong way? Or does this whole methodology need more thought?

Spea commented 9 years ago

There are currently some downsides on how the location for the cache is generated. I will change this in a future release, but currently you will need bower on the production server as well.

christheyounger commented 9 years ago

Well, actually you only need the source files and the compiled files on the server as far as I can tell. My guess is that assetic does some kind of hash or something and sees that the finished product is valid. On Jan 25, 2015 11:07 PM, "Martin Parsiegla" notifications@github.com wrote:

There are currently some downsides on how the location for the cache is generated. I will change this in a future release, but currently you will need bower on the production server as well.

Reply to this email directly or view it on GitHub https://github.com/Spea/SpBowerBundle/issues/121#issuecomment-71369400.