gulp-umd icon indicating copy to clipboard operation
gulp-umd copied to clipboard

LiveScript support

Open unclechu opened this issue 9 years ago • 4 comments

Any solutions for LiveScript support? Or CoffeeScript or TypeScript?

unclechu avatar Oct 08 '14 20:10 unclechu

Any resource example for how that should look like?

eduardolundgren avatar Oct 09 '14 17:10 eduardolundgren

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 avatar Oct 10 '14 19:10 unclechu

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

unclechu avatar Oct 10 '14 19:10 unclechu

SGTM. Yes, could you send this template implementation?

eduardolundgren avatar Oct 10 '14 21:10 eduardolundgren