Bakhtina Sofya b84cb877be 1st comm | 2 tygodni temu | |
---|---|---|
.. | ||
src | 2 tygodni temu | |
tests | 2 tygodni temu | |
.travis.yml | 2 tygodni temu | |
CHANGELOG.md | 2 tygodni temu | |
LICENSE.mit | 2 tygodni temu | |
README.md | 2 tygodni temu | |
ideas.md | 2 tygodni temu | |
package.json | 2 tygodni temu |
Run jscodeshift on Vue single file components
npm install vue-jscodeshift-adapter -D
The instructions below assume you're familiar with jscodeshift.
.js
and/or .vue
filesWhen transforming | fileInfo.source will be |
---|---|
.js |
the contents of the file |
.vue |
the contents of <script> |
The source file will be updated appropriately based on the return value of your transform()
.
If .vue
file doesn't have a <script>
, your transform()
will not be called and the source file will not be changed.
// my-transform.js
const adapt = require('vue-jscodeshift-adapter');
const someCodemod = require('some-codemod');
module.exports = adapt(someCodemod);
$ jscodeshift <path> -t my-transform.js --extensions vue,js
See jscodeshift readme for more info on jscodeshift CLI.
MIT