gulp-wrap-amd-infer
Gulp plugin to automatically wrap and optionally compile files for testing AMD
Last updated 6 years ago by kmalakoff .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-wrap-amd-infer 
SYNC missed versions from official npm registry.

gulp-wrap-amd-infer

Gulp plugin to automatically wrap and optionally compile files for testing AMD

gulp = require 'gulp'
wrapAMD = require 'gulp-wrap-amd-infer'

gulp.task 'build', ->
  gulp.src('test/some_test.coffee')
    .pipe(wrapAMD({
      path_files: [
        './node_modules/jquery/jquery.js'
        './node_modules/underscore/underscore.js'
        './node_modules/backbone/backbone.js'
      ]
      shims:
        underscore: {exports: '_'}
        backbone: {exports: 'Backbone', deps: ['underscore']}
      karma: true
    ))
    .pipe(gulp.dest('test/build'))

Output:

(function() {
  var _start = window.__karma__.start, _config; window.__karma__.start = function(config) { _config = config; };

  require.config({
  "paths": {
    "jquery": "/base/node_modules/jquery/jquery",
    "underscore": "/node_modules/underscore/underscore",
    "backbone": "/node_modules/backbone/backbone"
  },
  "shim": {
    "underscore": {
      "exports": "_"
    },
    "backbone": {
      "exports": "Backbone",
      "deps": [
        "underscore"
      ]
    }
  }
});

  require(["jquery","underscore","backbone"], function(){
    // test/some_test.coffee compiled to JavaScript

    _start(_config);
  });
}).call(this);

Current Tags

  • 0.1.1                                ...           latest (5 years ago)

11 Versions

  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           6 years ago
  • 0.0.9                                ...           6 years ago
  • 0.0.8                                ...           6 years ago
  • 0.0.7                                ...           6 years ago
  • 0.0.6                                ...           6 years ago
  • 0.0.5                                ...           6 years ago
  • 0.0.4                                ...           6 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |