gulp-wrap-define
Gulp plugin for wrapping files in a define statement
Last updated 6 years ago by kmalakoff .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-wrap-define 
SYNC missed versions from official npm registry.

gulp-wrap-define

Gulp plugin for wrapping files in a define statement.

Create a single JavaScript file with each file wrapped in define('file_name', function(exports, require, module) { /* file content */ });

gulp = require 'gulp'
define = require 'gulp-wrap-define'
concat = require 'gulp-concat'

gulp.task 'build', ->
  gulp.src('./lib/**/*.js')
    .pipe(define(root: './lib'))
    .pipe(concat('your-js-library.js'))
    .pipe(gulp.dest('./dist/'))

Create a single JavaScript file with each file wrapped in require.register('file_name', function(exports, require, module) { /* file content */ }); like Brunch.

gulp = require 'gulp'
coffee = require 'gulp-coffee'; gutil = require 'gulp-util'
define = require 'gulp-wrap-define'
concat = require 'gulp-concat'

gulp.task 'build', ->
  gulp.src('./src/**/*.coffee').pipe(coffee({bare: true}).on('error', gutil.log))
    .pipe(define({root: './src', define: 'require.register'}))
    .pipe(concat('your-cs-library.js'))
    .pipe(gulp.dest('./dist/'))

Current Tags

  • 0.0.3                                ...           latest (6 years ago)

3 Versions

  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 4
Dependencies (3)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |