1.1.1 • Published 7 years ago

gulp-dot-flatten v1.1.1

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

gulp-dot-flatten

Build Status Dependency Status Downloads NPM version License

gulp-dot-flatten is a gulp plugin to recursively flatten JS files into a single directory.

About

Will rewrite the following filenames when used with the usage example below:

/build/Main.js
/build/Foo/Bar.js
/build/Foo/Bar/Baz.js

Into this:

/dist/Main.js
/dist/Foo.Bar.js
/dist/Foo.Bar.Baz.js

Any require('./foo/bar') will be rewritten into require('./foo.bar').

This library is made specifically for usage with Screeps due to its lack of directory support.

Install

npm install --save-dev gulp-dot-flatten

Usage

var dotFlatten = require('gulp-dot-flatten');

gulp.task('flatten', () => {
    return gulp.src('./build/**/*.js')
        .pipe(dotFlatten())
        .pipe(gulp.dest('./dist'));
});

Options

dotFlatten(options)

options.stringFilter

Type: Function

Optional function in which the filename will pass through. Useful for things like forcing lowercase filenames, if desired.

Example:

var dotFlatten = require('gulp-dot-flatten');

gulp.task('flatten', () => {
    return gulp.src('./build/**/*.js')
        .pipe(dotFlatten({
            stringFilter: (str) => str.toLowerCase()
        }))
        .pipe(gulp.dest('./dist'));
});

options.verbose

Type: Boolean
Default: false

Attribution

gulp-dot-flatten is based on the inline library of the same name found in the Screeps TypeScript Starter Kit.

Original authors and contributors:

License

gulp-dot-flatten is open-sourced software licensed under the MIT License.

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago