vue-jscodeshift-adapter
Run jscodeshift on Vue single file components
Install
npm install vue-jscodeshift-adapter -D
Usage
These steps assume you're familiar with jscodeshift.
1. Wrap your transform function
This module wraps your transform function, enabling it to run on Vue single file components (sfc).
my-transform.js
:
const adapt = require('vue-jscodeshift-adapter');
function myTransform(fileInfo, api, options) {
const source = fileInfo.source;
return transformedSource;
}
module.exports = adapt(myTransform);
2. Run jscodeshift
$ jscodeshift <path> -t my-transform.js --extensions vue
See jscodeshift readme for more info.
License
MIT