HTML-Code:
<script data-main="workspace/assets/js/main.js" src="workspace/assets/js/require.js" /> <!-- (...) --> <script type="text/javascript"> require( ['lib/pic'], function( pic) { });</script>
Code:
requirejs.config({ paths: { jquery: 'vendor/jquery-1.10.2.min', underscore: 'vendor/underscore-min', backbone: 'vendor/backbone-min', }, shim: { 'backbone': { deps: ['underscore', 'jquery'], exports: 'Backbone' }, 'underscore': { exports: '_' } }, wrapShim: false, logLevel: 0 });
Code:
define(['backbone'], function (Backbone) {});
Zitat von access.log
Zitat von http://requirejs.org/docs/api.html#data-main
Kommentar