Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to work with commonjs module #234

Open
kevinuyoung opened this issue Jul 17, 2017 · 1 comment
Open

how to work with commonjs module #234

kevinuyoung opened this issue Jul 17, 2017 · 1 comment

Comments

@kevinuyoung
Copy link

kevinuyoung commented Jul 17, 2017

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.

@alundiak
Copy link
Collaborator

alundiak commented Oct 6, 2017

@Lorde-Y if I understand ur example correctly, then for doing that, I need to rework require-css codebase, and provide real bundled JS file, at least minified version, to contain full code, so that we can use CJS approach. I will try to work on it this weekend maybe. I'm also personally interested in this, because my project has odd require() of this component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants