Giter Site home page Giter Site logo

require's Introduction

require

A CommonJS module loader for the web.

CommonJS 模块化(Nodejs 使用的模块规范)加载器。

example

Step 1: install dependencies

npm install
npm start

Step 2: open example at:
http://127.0.0.1:8080/example/

online demo

Usage

<script src-entry="./path/to/main/file"></script>

or

requireLoad('./path/to/main/file')

More

CommonJS modules are loaded using XMLHttpRequest, so pay attention to the case of cross origin.
Please use webpack or gulp to pack your CommonJS modules.

CommonJS 模块加载器的实现使用了 Ajax,因此对于部署在其他服务器上的静态资源,可能加载不了。
开发这个项目的目的主要是学习和娱乐,在生产环境,还得使用 webpack 之类的工具打包发布。

require's People

Contributors

meowtec avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.