Optimize non-layered files in dojo build
How do I tell the dojo 开发者_运维百科build system to run the shrinksafe optimization on files NOT included in a layer but in the perfixes directories?
Thanks
There are two optimization parameters for custom builds: optimize
and layerOptimize
. In your case, you would need to set optimize=shrinksafe
.
optimize Specifies how to optimize module files. If "comments" is specified, then code comments are stripped. If "shrinksafe" is specified, then the Dojo compressor will be used on the files, and line returns will be removed. If "shrinksafe.keepLines" is specified, then the Dojo compressor will be used on the files, and line returns will be preserved. If "packer" is specified, Then Dean Edwards' Packer will be used Default: "",
layerOptimize Specifies how to optimize the layer files. If "comments" is specified, then code comments are stripped. If "shrinksafe" is specified, then the Dojo compressor will be used on the files, and line returns will be removed. If "shrinksafe.keepLines" is specified, then the Dojo compressor will be used on the layer files, and line returns will be preserved. If "packer" is specified, Then Dean Edwards' Packer will be used Default: "shrinksafe",
You need to declare the folder that contains the files to optimise as a package in the build profile so that it can be optimised.
packages: [
{
name:"dojo",
location:"dojo"
},
{
name:"filesToOptimise",
location:"folderLocation"
}
]
Make sure you have a profile.js and package.json in that directory and optimize:"shrinksafe"
option in your build profile as well.
精彩评论