0.0.2 • Published 7 years ago

gulp-common-to-amd v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

gulp plugin that converts commonjs to AMD

based on gulp-es6-to-amd

Installation

npm install gulp-common-to-amd --save

Usage

Convert files with:

const gulp = require('gulp');
const commonToAmd = require('gulp-common-to-amd');

module.exports = function (options) {
    return gulp.src(options.src)
    .pipe(commonToAmd())
    .pipe(gulp.dest(options.dest));
};

Example:

commonjs

var lib = require("./lib");
 
module.exports = {lib: lib};

AMD

define(['./lib'], function (lib) {
    'use strict';
    return {
        lib: lib
    };
});