YUI Compressor - compress from one directory to another - yui-compressor

I am on Win 7 and I want to compress my js/css files with YUI Compressor.
It uses require.js so I would like to keep the file names and folder structure same, before and after the compress.
I put the original js files into oldjs/ folder and want minified js files to be outputted into js/ folder.
Is there any way to do that?

Related

Minify / compress JS and CSS by Server?

my webpage is running on an Apache Server, because of big CSS and JS files I want to minify/compress the files like this:
If the CSS/JS file is changed, the Server should that that changed file, compress it and save it as a new file?
How can I do that?
You can use Gulp https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md it can minify automatically anytime you modify your styles.

How to include the dijit.css and other related .css files in the dojo build file

I'm trying to create a dojo build file. What do I need to add in the profile.js file to include all the .css files inside the dojo build.js file. I'm getting dijit.js and other .js files, but the dependent .css files are not getting built into the build.js file
I'm using dojo 1.8
It doesn't really make sense to ask to combine JS and CSS into a single file. JavaScript is JavaScript; CSS is CSS.
That said, you should be able to get down to as little as one CSS request by specifying cssOptimize: 'comments' in your build profile, which will strip comments from CSS files within packages the build processes, and flatten imports. As a result, each Dijit theme's main CSS file (e.g. themes/claro/claro.css) will then require only one request, rather than requests for each component.

How to include JS/CSS files from subfolders

How do I make sure JavaScript and CSS files in subfolders are included / excluded from being rendered by the RegisterScripts() method?
Is it possible to use WebResource.config for site themes?

YUI Compressor to compress all the files in a directory

I have a js folder that contains n number of javascript files (I might add/remove some files from that folder)
can I do something like that?
java -jar yuicompressor.jar dev/js/* -o dev/js/main.min.js
I want to merge all the files in that directory into a minified main.min.js but the command is not working. (if I put a file name instead of the * it works)

Does YUI compressor have support for rewriting relative paths?

The problems is that when I run YUI compressor (.NET MsBuild task) the minified css file preserves the same relative paths as in the original ones and given my content structure, this results incorrect paths to images and other resources. Does YUI have an option to configure it to rewrite this URLs? If it doesn't, are there other tools that do could help with this?