@start/plugin-rename
v2.0.0
Published
🔠 Rename files
Downloads
168
Readme
🔠 plugin-rename
Rename files.
Install
$ yarn add --dev @start/plugin-rename
Usage
Signature
rename(callback: (file: string) => string)
Example
import sequence from '@start/plugin-sequence'
import find from '@start/plugin-find'
import read from '@start/plugin-read'
import babel from '@start/plugin-lib-babel'
import rename from '@start/plugin-rename'
import write from '@start/plugin-write'
const babelConfig = {
// …
babelrc: false,
sourceMap: true,
}
export const task = () =>
sequence(
find('src/*.ts'),
read,
babel(babelConfig),
rename((file) => file.replace(/\.ts$/, '.js')),
write('build/')
)