gulp-common-to-amd

0.0.2 • Public • Published

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
    };
});

Package Sidebar

Install

npm i gulp-common-to-amd

Weekly Downloads

3

Version

0.0.2

License

MIT

Last publish

Collaborators

  • senntyou