How can I tell Symfony to ignore a file with a certain suffix in the Bundle's /translations directory?
for example, I would like it to ignore the .pot file but if I put one there, it then tries to load it and cannot find a loader.
Related
In another SO post here, the second option is to write G.this; in the first "top" file in order to create a namespace.
And then write "use strict" on the top of every other js file.
Is that all the content of such a file? and if so, where the "top" file should be located (server, client, both) and what name? as Meteor loads files based on their paths. Thanks
One of ways to create a global namespace in Meteor (as suggested in the SO answer) is to have a file where a global alias to this is declared, such as:
G = this;
This file should, ideally, be loaded first and on both client and server.
To achieve this, according to the doc:
Files within lib/ directory are loaded first (after loading template files on client).
Meteor will load any file outside client/ or server/ directories on both client and server.
Where no other rules may apply, alphabetical ordering of the paths is used to determine load order of the files.
So, in keeping with these rules I would save the file as app.js (or any similar name that would come first alphabetically). Then I would place this file at the root of lib/ folder so that it gets loaded both on client and server.
So, the path to app.js would be : ./your_meteor_project_root/lib/app.js
Lets assume I have 2 static assets (html files) in my project, files a.html and b.html.
File a.html has a link to file b.html inside of it.
Now I run a build and the 2 files got their name changed and everything is working fine (by the filerev module).
Now I need to make a small change only in file b.html -> filerev will give a new name to file b.html in the next build. Because file a was not changed it will have the same name as the prev build.
Now, in the next build usemin will go to file a and will fix the link to the new file b name and everything looks fine. But not, because file a still has the same name as prev build, users will get a broken link when trying to access file b from a.
I guess a workaround is to instead of having hashes of the file names, generate random file names each time.
That way you are generating all files so it is not optimized, but you prevent the caching problems between versions, while still allow caching of the browser for the same version.
Using the grunt-angular-template task can solve this issue as it is adding all the templates to the $templateCache of angular, so the no real requests will be made to the server when a template is requested and the recent template is loaded from the cache. Of course it is not ideal as in big applications you will not want this as this may increase your js file size
I'm currently using YUI Compressor to compress my CSS files in a project which worked fine but because of multiple files for plugins I decided to use subfolders in my CSS folder. How can I make the File Watcher also work on subfolders? I can't seem to find any documentation on this, nor have I found anyone with the same problem on the web.
I don't mind if all CSS files throughout the whole project scope gets minified, but I want to avoid defining new File Watcher every time I create a new subfolder.
PS: I see a checked "Track only root files" option in the Edit Watcher screen, but it's greyed out, so I can't turn it off. Don't know why this option is provided, since it always seems to be greyed out, no matter what settings I try.
Not sure i understand what subfolders are meant. With default scope (Project Files) all .css files in the project (root folder with all subfolders, recursively) are watched - why do you need to create a new watcher when adding a folder? Do you use some custom scopes in your watcher(s)?
Found it!
The "Track only root files" option not being optional was not the (or atleast not the whole) problem. This was bypassable by not using the default YUI Compressor file watcher template but creating a custom one.
The real problem was that my scope was set to Project files (the Root of the project) but the Arguments string being set to $FilePath$.css -o $FilePathWithoutAllExtensions$.min.css. What this means is that The watcher was searching for C:/[PROJECTPATH]/[SUBFOLDERS]/[FILENAME].css in the Project root, and then outputting it into the Root of the project (-o $FileNameWithoutExtension$.min.css).
With some fiddling with the Arguments and the Insert Macro's function i made this new Arguments string: $FileDirRelativeToProjectRoot$\$FileNameWithoutAllExtensions$.css -o $FileDirRelativeToProjectRoot$\$FileNameWithoutAllExtensions$.min.css. It now watches all [FILENAME].css files and places the minified versions in the same folder of the original.
Using the Show console: Always instead of Show console: Error option really helped me figuring out this problem since not finding a file to minify, based on the arguments, apparently is "not an error".
Hope this explanation will help to safe some frustration and hours for everyone who encounters this problem.
I struggle a while with this also due to the fact that you always have to apply settings, make some change on the SCSS File and see if it's working.
My setup is working find now for a following structure:
// Source
./scss/
- styles.scss
- _variables.scss
- subfolder/
- more-styles.scss
// Output
./css
- styles.css
- subfolder/
- more-styles.css
My File Watcher Settings look like that:
// Program:
sass
// Arguments:
./$FileDirPathFromParent(scss)$$FileName$:../css/$FileDirPathFromParent(scss)$$FileNameWithoutExtension$.css
// Output paths to refresh:
$FileNameWithoutExtension$.css:$FileNameWithoutExtension$.css.map
// Working directory:
$Projectpath$/scss/
One of the keys was to set the working directory correctly, for example $FileDir$ is just the SCSS file is in, so the relative paths are wrong.
I used yiibooster I have changed many styles under /assets/73dd67/bootstrap/css/bootstrap-min.css
But when I changed my webapp name, the CSS files not found, I mean the folder '73dd67' changed to '253ft6'.
The same case when I moved my webapp to another computer. The '73dd67' folder changed again in another name.
What can I do so I can keep the CSS formatting?
Thanks for your answers
Asset folder have only cached files. You made changes in cached file not actual file.
So find the actual location of bootstrap-min.css and do your changes. After doing changes, just remove all cache folders inside the asset folder. Then you can see the output in next refresh itself.
Hope you are using yIIbooster as extension. So do your changes in extension css/bootstrap-min.css file.
I have a Symfony2 bundle which contains some wsdl files in Resources directory. It forces me to define some additional entries in config file like:
parameters.fx_wsdl = '../vendor/project-name/bundleName-bundle/vendorName/xxxBundle/Resources/confid/ws/fx.wsdl'
yeach, as you see it looks ugly. Is there a way to define it as:
parameters.fx_wsdl = 'VendorNameBundleNameBundle/Resources/confid/ws/fx.wsdl'
any object which can translate VendorNameBundleNameBundle into ../vendor/project-name/bundleName-bundle/vendorName/xxxBundle automatically