gulp-rewrite-imports
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

gulp-rewrite-imports

NPM

A gulp plugin which allows to rewrite import and require statements in JavaScript and TypeScript files.

Install

The plugin can be installed as follows:

Yarn:

yarn add --dev gulp-rewrite-imports

NPM:

npm install --save-dev gulp-rewrite-imports

Basic usage

const { src, dest } = require('gulp');
const rewriteImports = require('gulp-rewrite-imports');

src('./src/**/*.js')
    .pipe(rewriteImports({
        mappings: {
            'some-module-name': 'another-module-name',
            'foo', {
                path: './some/nested/file/bar.js',
                relativeTo: './dist',
            },
        },
    })
    .pipe(dest('./dist'));

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.02latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.02
1.0.60
1.0.30

Package Sidebar

Install

npm i gulp-rewrite-imports

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

7.54 kB

Total Files

5

Last publish

Collaborators

  • kremi151