Skip to content

daxingplay/relyJS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

##API https://github.com/neekey/relyJS/wiki

##reqJS UPDATE
添加了和nodejs同样的方式来导入模块

1. 导入模块

	var module = $r.require('moduleName')

2. 模块写法

	var hello = function(){
		console.log('hello!');
	};
	exports.hello = hello;

3. 只能在以 $r.load 方法载入的js文件中使用 $r.require 方法

4. 之前嵌套模块导入

5. 包管理在研发中= =

6. 具体见test文件夹中的简单demo
  

##Description
relyJS is used to load resources, and provides a simple way to import other script files within script file!

This project is developed to solve the problem I encountered in my html5 game-project, which is i have to finished loading all the resource the game need.

This project can be used to load the script files, plain data files (html, css, json), images, etc.

##Simple example:
	$r.load( { 
		url: ['a.js', 'http://neekey.net/bg.png', '../html/b.html' ], 
		callback: function( module, userData ){}
	});

alse we can import other resource like we do in JAVA or C++, simple like this:

in a.js file :
	$r._rely(['b.js', '../c.js']);
	/* main code in a.js */
	

About

a resource loader for javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published