简体   繁体   English

DOJO构建不包括DOJO基础

[英]DOJO build that does not include DOJO base

Is this possible using v1.6.1? 这可能使用v1.6.1吗? Due to the Xdomain configuration of my client's dojo deployment, it is necessary to execute a new build each time dev code changes. 由于我的客户端的dojo部署的Xdomain配置,每次dev代码更改时都需要执行新的构建。 As you can imagine, this is a huge time waster. 你可以想象,这是一个巨大的浪费时间。

From everything I can see there is no way to exempt the core from the build playing by DOJOs rules. 从我能看到的一切来看,没有办法将核心从DOJO规则的构建中豁免。 So I am wondering if there is a way to break the rules (modifying the Rhino calls?) to get to where I need to be. 所以我想知道是否有办法打破规则(修改Rhino调用?)到达我需要的位置。

A couple thoughts. 几个想法。

  1. You can avoid building most of dojo (dijit, dojox) but I imagine you already know that 你可以避免构建大部分的dojo(dijit,dojox),但我想你已经知道了
  2. This restriction you are facing seems odd. 你面临的这种限制似乎很奇怪。 Isn't there some way you can just upload the specific JS files you are editing during development? 有没有什么方法可以上传您在开发过程中编辑的特定JS文件?

Maybe if you give more details on the client setup, I can help you brainstorm a way around this problem. 也许如果你提供有关客户端设置的更多细节,我可以帮助你集思广益解决这个问题。

Update Here's what I think you need: Customize Dojo Base in Build . 更新这里是我认为你需要的: 在Build中自定义Dojo Base This allows you to specify particular bits of the dojo base to include. 这允许您指定要包含的dojo基的特定位。

This works in pre-1.7, so you should be good. 这适用于1.7之前,所以你应该是好的。

Appears to be exactly what you want: 似乎正是你想要的:

layers: [
  {
       name: "dojo.js",
       customBase: true,
       dependencies: [
       ]
  },

 // ... remainder of profile

 ]

This will give you the absolute bare minimum of dojo (which you still don't need for your dev scenario, but which will drastically reduce the amount of files processed). 这将为您提供绝对最低限度的dojo(您仍然不需要您的开发方案,但这将大大减少处理的文件数量)。

For other use cases, you can use the dependencies attribute to add in other stuff from dojo core. 对于其他用例,您可以使用dependencies属性添加dojo核心中的其他内容。

Update 2: Here's a couple build-time optimization suggestions: 更新2:这里有几个构建时优化建议:

1) Don't intern strings, and don't compress, when in dev. 1)开发时不要实习字符串,也不要压缩。 There are arg values you can pass to avoid these time-consuming steps (example is for ant build): 您可以传递arg值以避免这些耗时的步骤(例如,对于ant构建):

<arg value="internStrings=false"/>
<arg value="layerOptimize=false"/>

2) Build to a ram disk to speed copying of files 2)构建到ram磁盘以加快文件复制速度

Dojo supports mix-and-match - so you can use xdomain and/or custom build for the stuff that does not change - and use regular dojo.require for the JS/widget that is changing often - and then just push that JS to see the change without a new xdomain/custom build/deployment Dojo支持混合匹配 - 所以你可以使用xdomain和/或自定义构建来处理那些不会改变的东西 - 并且经常使用常规的dojo.require来替换那些经常更改的JS / widget - 然后只需要推送JS来查看没有新的xdomain /自定义构建/部署的更改

You can explore using local modules with xdomain build . 您可以使用xdomain build的本地模块进行探索 Also, Dojo allows using multiple custom builds - so you can do a stable custom build for the widgets that don't change so much and another smaller build for code that is changing frequently. 此外,Dojo允许使用多个自定义构建 - 因此您可以为不会发生太大变化的小部件执行稳定的自定义构建,并为经常更改的代码执行另一个较小的构建。

Why not use dojo 1.7, load asynchronously, and rely on it's legacy support? 为什么不使用dojo 1.7,异步加载,并依赖它的遗留支持? http://livedocs.dojotoolkit.org/loader/amd http://livedocs.dojotoolkit.org/loader/amd

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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