npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

gulp-es6-imports-renamer

0.1.8 • Public • Published

gulp-es6-imports-renamer

Gulp plugin for es6-imports-renamer., which renames paths from es6 import declarations.

Usage

var gulp = require('gulp');
var rename = require('gulp-es6-imports-renamer');
 
gulp.task('rename', function() {
    gulp.src('src/*.js')
        .pipe(rename({renameFn: renameFn}))
        .pipe(gulp.dest('dist'));
});

Renaming dependencies with gulp can be very useful right before running a module transpiler:

var gulp = require('gulp');
var rename = require('gulp-es6-imports-renamer');
var transpile = require('gulp-es6-module-transpiler');
 
gulp.task('rename', function() {
    gulp.src('src/*.js')
        .pipe(rename({renameFn: renameFn}))
        .pipe(transpile({formatter: 'bundle'}))
        .pipe(gulp.dest('dist'));
});

That way you can build a bundle with all dependencies, including external ones (like jspm packages).

API

config

Accepts all config options accepted by es6-imports-renamer, except sources, as that is filled automatically by gulp-es6-imports-renamer from the files that are received through the stream.

install

npm i gulp-es6-imports-renamer

Downloadsweekly downloads

10

version

0.1.8

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability