https://github.com/seebigs/bundl-rename
https://github.com/seebigs/bundl-rename
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/seebigs/bundl-rename
- Owner: seebigs
- Created: 2016-08-05T14:25:52.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-05-17T19:32:55.000Z (about 8 years ago)
- Last Synced: 2025-10-23T03:12:00.219Z (8 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bundl-rename
*Rename bundles*
*Runs with the amazing [Bundl](https://github.com/seebigs/bundl) build tool*
## Install
```
$ npm install --save-dev bundl-rename
```
## Use
```js
var Bundl = require('bundl');
var minify = require('bundl-minify');
var rename = require('bundl-rename');
var write = require('bundl-write');
new Bundl(targets)
.then(write())
.then(minify())
.then(rename(options))
.then(write())
.go();
```
## Options
### Replace file extension only
```js
rename('.new.ext')
rename({
ext: '.new.ext'
})
// original1.js --> original1.new.ext
// original2.js --> original2.new.ext
// original3.js --> original3.new.ext
```
### Prefix or Suffix
```js
rename({
prefix: '__',
suffix: '.new'
})
// original1.js --> __original1.js.new
// original2.js --> __original2.js.new
// original3.js --> __original3.js.new
```
### Remap specific file names
*(files not included in the map will not be renamed)*
```js
rename({
remap: {
'original1.js': 'one.new',
'original2.js': 'two.new'
}
})
// original1.js --> one.new
// original2.js --> two.new
// original3.js --> original3.js
```