File tree 4 files changed +19
-11
lines changed
src/Yoda/EventBundle/Resources/views
4 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -36,4 +36,6 @@ Optimization
36
36
read - we're basically abusing it
37
37
- ./node_modules/.bin/r.js -o app/config/build.js
38
38
- temporarily added a path to js-built inside Twig
39
- - added more items to common.js beyond just jQuery
39
+ - added more items to common.js beyond just jQuery
40
+ - optimized a single page
41
+ PPP common.js is still pointing to the "js" directory, not js-built!
Original file line number Diff line number Diff line change 1
1
( {
2
2
mainConfigFile : '../../web/assets/js/common.js' ,
3
- appDir : '../../web/assets/js' ,
4
- baseUrl : './' ,
5
- dir : '../../web/assets/js-built' ,
3
+ appDir : '../../web/assets' ,
4
+ baseUrl : './js' ,
5
+ dir : '../../web/assets-built' ,
6
+ optimizeCss : "none" ,
6
7
modules : [
7
8
//First set up the common build layer.
8
9
{
Original file line number Diff line number Diff line change 1
- <script src =" {{ asset(' assets/vendor/requirejs/require.js' ) }}" ></script >
1
+ {% set useCompiled = true %}
2
+ {% set assetsPath = ' assets' ~(useCompiled ? ' -built' ) %}
3
+
4
+ <script src =" {{ asset(assetsPath~' /vendor/requirejs/require.js' ) }}" ></script >
2
5
<script >
3
- require ([' {{ asset(' assets/ js/ common .js ' ) }}' ], function (common ) {
4
- // js/common sets the baseUrl to be js/ so
5
- // can just ask for 'app/main1' here instead
6
- // of 'js/app/main1'
6
+
7
+ // let the baseUrl be dynamic so we can use the compiled assets when needed
8
+ requirejs .config ({
9
+ baseUrl: ' {{ assetsPath }}/js'
10
+ });
11
+
12
+ require ([' common' ], function (common ) {
7
13
require ([' {{ data_main }}' ]);
8
14
});
9
- </script >
15
+ </script >
Original file line number Diff line number Diff line change 6
6
//except for 'app' ones, which are in a sibling
7
7
//directory.
8
8
requirejs . config ( {
9
- baseUrl : 'assets/js' ,
10
9
paths : {
11
10
app : 'app' ,
12
11
domReady : '../vendor/requirejs-domready/domReady' ,
You can’t perform that action at this time.
0 commit comments