assetic

Symfony2 Assetic Don't Generate Composite File on --env=dev

只谈情不闲聊 提交于 2019-12-11 04:38:43
问题 Is there any way to tell the Assetic command-line file to not generate the composite "output" file when it builds for the dev environment? We have it running with the --watch configuration. We have composite files which take a long time to generate and aren't used, so it's a serious waste of time. It also causes it to regenerate all files in that stack, instead of the one single one that changes. Any ideas? If there isn't, I'm half-tempted to override the asset:dump command myself because we

Twitter Bootstrap glyphicons font's not found when using assetic in prod on Symfony2

我的梦境 提交于 2019-12-10 16:39:50
问题 I've read a lot of posts about this but couldn't get this to work for my project. So basiclly I have a Symfony2 project which includes twitter bootstrap (v3). Every thing works fine in dev mode but when I try it in prod mode i got errors saying that the twitter bootstrap fonts couldn't be found: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/Symfony/css/fonts/glyphicons-halflings-regular.woff Failed to load resource: the server responded

symfony assetic gives 500 error when requesting files

青春壹個敷衍的年華 提交于 2019-12-10 14:44:38
问题 EDITED : I am using assetic with symfony2. Each time I try to load a page, on requesting for the JS and CSS files, my browser gets a 500 error. If I type the address of that resource in address bar, I can load its file successfully! Even weirder, the CPU load increases like 30% whenever Symfony boots up! I tried assets:install and assetic:dump --no-debug , guess what, none of the symfony pages load anymore. They all end in 500 error. I don't think it is caused by apache. I can load any other

Loading resources conditionally with Assetic

你说的曾经没有我的故事 提交于 2019-12-10 10:35:43
问题 Is it possible to load assets conditionally with Assetic? For example (peusocode): load resource1.js load resource2.js if condition = true load resource3.js endif output combined.js 回答1: No it's not possible because assetic files are compiled on the server side, so assetic don't have access to the value of your variable at runtime. A solution could be to add a second assetic tag // the first assetic tag {% if condition %} // an other assetic tag {% endif %} 回答2: I came across to exactly the

Symfony 2 how to import LESS files from another bundle

六眼飞鱼酱① 提交于 2019-12-10 04:35:52
问题 LESS has the power to @import other LESS files. This question is intended to find a solution to import LESS files within LESS files from another Bundle in a Symfony project I'm working on a Symfony2 project, using LESS and Assetic to watch changes. My LESS files are able to import other LESS files but only if they are in the same bundle. If I try to import from another bundle Assetic watch stops with error "variable undefined" because the import fails. I've tried all sorts of paths in the

How to make Symfony 2 asset compilation to product different filenames?

℡╲_俬逩灬. 提交于 2019-12-10 01:30:02
问题 I followed the guide on the very bottom of this article: http://symfony.com/doc/current/cookbook/assetic/asset_management.html I have this code: {% javascripts ... output='js/dist/dist.js' %} <script src="{{ asset_url }}"></script> {% endjavascripts %} Now if I run sf assetic:dump --env=prod it creates the compiled file properly. However, I would like to have it generating a random name (or timestamped) so that the client-side browser cache problem is avoided. Right now it always creates dist

Symfony Assetic - part_1 in url

╄→гoц情女王★ 提交于 2019-12-08 17:15:00
问题 Okay so I've been searching all over for some input into this but haven't found anything to help directly (only mentions of this problem in relation to something else). Basically I'm having problems with the path assetic generates when looking for an assetic file versus what is actually generated. The path it's trying to load is: /js/admin_part_1.js whereas the file it is generating is simply /js/admin.js I am dumping files with: php app/console assetic:dump --env=prod --no-debug Relevant

using less with symfony2 on windows

烂漫一生 提交于 2019-12-08 04:30:38
问题 Im trying to get Less with assetic working while developing on a windows OS. Im loading an existing project of which I can alter the config.yml and parameters.yml files as necessary. steps so far: I have installed Node.js via the msi installer I have used npm and installed less gloabally config.yml assetic: debug: %kernel.debug% use_controller: false bundles: [ FOSUserBundle ] filters: less: node: "C:\\Program Files (x86)\\nodejs\\node.exe" #/usr/local/bin/node node_paths: [C:\Users\matt

How to prepend assets version to css and js?

牧云@^-^@ 提交于 2019-12-08 02:58:31
问题 I want assetic to output compressed js and css to something like this: v2.3.1/css/whatever.css Currently this is how I dump my css and js for production: $ php app/console assetic:dump --env=prod --no-debug . But they get dumped into css/ and js/, without the version. I have read this but it seems to refer to images only, not css/js. An important reason for doing this is for cache busting/invalidation. 回答1: Yes, known issue... In our production workflow we ended up with such block in bin

Using Twig as an Assetic filter for JavaScript in Symfony2

人盡茶涼 提交于 2019-12-07 15:09:55
问题 Is there a way to use Twig as an Assetic filter? What I want to do is have Twig parse my JavaScript files as Twig templates, and then pass them to Assetic so that they get combined and minified in production. You might be scratching your head thinking why I would want to do this in the first place, so let me jump to an example. I am making a game engine in JavaScript and I need to have two versions of several 'classes'. One version for the user and another for the editor. An example of one of