You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/faq-advanced.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ <h4>2) Modify loaded files</h4>
48
48
}(myGlobalRequire));
49
49
</code></pre>
50
50
51
-
<p>Following the steps above should allow you to use the optimization tool to combine scripts together effectively. You should not use the <strong>includeRequire</strong> optimization option though. If you want your renamed require definition in the optimized script, reference your modified require.js directly in the <strong>include</strong> optimization option, or as the <strong>name</strong> option if you want to optimize that file directly.</p>
51
+
<p>Following the steps above should allow you to use the optimization tool to combine scripts together effectively. If you want your renamed require definition in the optimized script, reference your modified require.js directly in the <strong>include</strong> optimization option, or as the <strong>name</strong> option if you want to optimize that file directly.</p>
52
52
53
53
<p>Thanks to <ahref="http://alexsexton.com/">Alex Sexton</a> and <ahref="http://tobielangel.com/">Tobie Langel</a> for suggesting parts of this solution.</p>
Copy file name to clipboardExpand all lines: docs/optimization.html
+6-4Lines changed: 6 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -135,12 +135,14 @@ <h2>
135
135
136
136
<p>Normally you should <strong>not</strong> save optimized files with your pristine project source. Normally you would save them to a copy of your project, but to make this example easier it is saved with the source. Change the <strong>out=</strong> option to any directory you like, that has a copy of your source. Then, you can change the main-built.js file name to just main.js so the HTML page will load the optimized version of the file.</p>
137
137
138
-
<p>If you wanted to include require.js with the main.js source, you can use this command:</p>
138
+
<p>It is not recommended that you bundle require.js with your main.js file. Ideally require.js should be the same file contents wherever it is used. However, if you do need to include require.js with the main.js source, you can use this command:</p>
<p>Once that is done, you can then rename the main-built.js file to require.js and your optimized project will only need to make one script request!</p>
143
+
<p>Since "require" is a reserved dependency name, you create a "requireLib" dependency and map it to the require.js file.</p>
144
+
145
+
<p>Once that optimization is done, you can then rename the main-built.js file to require.js and your optimized project will only need to make one script request.</p>
144
146
</div>
145
147
146
148
<divclass="section">
@@ -150,7 +152,7 @@ <h2><a name="shallow">Shallow exclusions for fast development</a><span class="se
150
152
151
153
<p>You can do this by using the <strong>excludeShallow</strong> option. Using the <ahref="#example">example setup</a> above, assume you are currently building out or debugging two.js. You could use thing optimization command:</p>
0 commit comments