Skip to content

how to work with commonjs module #234

Description

@kevinuyoung

when i use like this:

define(['require', 'jquery', 'css!home'], function(require, $) {
  var common = require('common/common');
  console.log(common);
});

It throws error "Uncaught Error: Module name "common/common" has not been loaded yet for context: _".
But when I use code: http://requirejs.org/docs/node.html#2

define(function(require) {
  var common = require('common/common');
  console.log(common);
});

It works;

How can I use both require-css and commonJs Module? Thank you.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions