M Gottlieb
M Gottlieb

Reputation: 1

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

Upvotes: 0

Views: 623

Answers (2)

harun
harun

Reputation: 1919

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.

Upvotes: 0

Maine
Maine

Reputation: 1878

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",

Upvotes: 1

Related Questions