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

LiveScript support #3

Open
unclechu opened this issue Oct 8, 2014 · 4 comments
Open

LiveScript support #3

unclechu opened this issue Oct 8, 2014 · 4 comments

Comments

@unclechu
Copy link

unclechu commented Oct 8, 2014

Any solutions for LiveScript support? Or CoffeeScript or TypeScript?

@eduardolundgren
Copy link
Owner

Any resource example for how that should look like?

@unclechu
Copy link
Author

Now wrapper looks like this:

(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.EXPORT_VAR_NAME = factory();
}
}(this, function() {
return SOME_VAR_NAME;
}));

But we can't wrap LiveScript or CoffeeScript or TypeScript code (if we doesn't build native js). But if gulp-umd could, that must looks like something like this (LiveScript):

let
  init = (root, factory) !->
    if typeof define is \function and define.amd
      define [] , factory
    else if typeof exports is \object
      module.exports = factory!
    else
      root.EXPORT_VAR_NAME = factory!
  init this , ->
    SOME_VAR_NAME

@unclechu
Copy link
Author

It looks like I can just create some another template, and use this templates in "template" option for gulp task?

@eduardolundgren
Copy link
Owner

SGTM. Yes, could you send this template implementation?

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