简体   繁体   中英

Dojo build AT run time

I am building several dojo custom builds using profiles,I found that extremely useful, but it takes literally one hour to create my builds. I would like that my application would "fetch" only what needed. Here is my question:

Is it possible to have profiles at run time?

Let's say my profile (called my.test.profile ) has dojo.data ,

dojo.ItemFileWriteStore

Eg Instead of calling

dojo.require("dojo.data") dojo.require(dojo.ItemFileWriteStore)

->

dojo.require("my.test.profile")

Is this possible to do in dojo?

You can create an intermediate layer file to bundle up requires:

//mylayer.js
dojo.provide('mylayer');
dojo.require(...);
dojo.require(...);
//...

So you can require only it instead of that bunch of stuff

//my_other_file.js
dojo.erquire('mylayer');

It is also possible to use the layerDependencies settings on the profile to make it so that the code is compiled into seperate layers instead of just a single blob (this if you want to be able to lazy-load a part that is not often used)

I don't know how to make the build process faster or what is the propper way to do this with the new AMD modules though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM