Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

implement requirejs module format #626

Closed
@jmesserly

Description

@jmesserly

... to replace our "legacy" one. We don't have to remove legacy yet but this opens the door.

The reason to support both RequireJS and CommonJS (our "--modules=node" format) is that RequireJS is to offer more options & compatibility, and require is a wee bit more friendly for browsers (as the code is already wrapped in a "define", the script can be executed directly).

http://requirejs.org/docs/start.html
here's an example app
https://github.com/volojs/create-template/tree/master/www

it looks roughly:

define(function (require) {
    // Load any app-specific modules
    // with a relative require call,
    // like:
    var messages = require('./messages');

    // Load library/vendor modules using
    // full IDs, like:
    var print = require('print');

    print(messages.getHello());

    // exports are returned here
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @jmesserly

      Issue actions

        implement requirejs module format · Issue #626 · dart-archive/dev_compiler