Rename ids with aster.
First, install aster-rename-ids
as a development dependency:
npm install --save-dev aster-rename-ids
Then, add it to your build script:
var aster = require('aster');
var renameIds = require('aster-rename-ids');
aster.src('src/**/*.js')
.map(renameIds({
from: /^_(.*)$/,
to: function () {
return '$' + privateIndex++;
}
}))
.map(aster.dest('dist'))
.subscribe(aster.runner);
Type: RegExp
Pattern for identifiers you want to rename.
Type: String
| Function
Replacement for given identifier patterns.