最終更新:2021-02-25 (木) 23:59:21 (112d)  

RequireJS
Top / RequireJS

http://requirejs.org/

概要

  • RequireJS is a JavaScript file and module loader.
  • It is optimized for in-browser use, but it can be used in other JavaScript environments, like Rhino and Node.js.
  • Using a modular script loader like RequireJS will improve the speed and quality of your code.

使い方

  • <script data-main="main.js" src="require.js"></script>
    require(['util'], function(util) {
        var result = util.add(10, 21);
        console.log('10 + 21 = ' + result);
    });

スライド

関連