includejs

2019-10-09 admin

includejs是什么

什么是includejs,Resource Loader

includejs使用教程帮助文档

IncludeJS

The Resource Loader for Browsers and NodeJS with AMD and CommonJS support.

Build Status NPM version Bower version

Features:

  • Loads any content: scripts, styles, ajax

  • Development friendly: incremental builds are not required

  • ES6 Imports

  • Production: Build the application into single html, js and css @see the app-bundler

  • Inline Dependency Declaration

    No external files, such as package.json or config.js

  • Load any javascript

  • No prerequests for module declaration. But supports also CommonJS and include.exports

  • Namespaced routing

     include
     	.routes({ controller: '/src/controllers/{0}.js' }); 
     	//... 
     include
     	.js({controller: 'user' });
    
  • Parameterized include

     // foo.js
     include.js({ compo: 'baz?color=green' });
    
     // baz.js
     document.body.style.backgroundColor = include.iparams.color
    
  • Javascript Aliases

     include.js('myScript.js::Logger').done(function(response){
     	response.Logger.logMe();
     });	
    
  • Custom Loader Support

  • Lazy Modules

    Scripts will be evaluated only when you needs them

  • Pause resource loading

     // pause current module
     var resume = include.pause();
    
     someAsyncJob(function(){
     	// resume with exports example
     	resume({ baz: 'quux' });
     })
    

<g-emoji class=“g-emoji” alias=“copyright” fallback-src=“https://github.githubassets.com/images/icons/emoji/unicode/00a9.png”>©️</g-emoji> 2014 Atma.js Project

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-76959.html

文章标题:includejs

回到顶部