Vik*_*ikR 4 migration node.js reactjs material-ui jscodeshift
我正在从 Material-UI 0.x 更新到 1.0。
迁移助手的文档说要运行:
jscodeshift -t <codemod-script> <path>.
Run Code Online (Sandbox Code Playgroud)
我以前从未使用过 jscodeshift,也从未见过这种表示法,所以我想就如何使用它获得一些建议。:) 谷歌搜索jscodeshift codemod-script没有发现任何相关内容。
codemod-script需要什么?
我花了一些时间才弄清楚这一点。安装 jscodeshift 和 material-ui codemods 后,命令格式应如下所示:
jscodeshift -t <the file path of the specific code mod file> <the location of the files you want to process>
jscodeshift -t ./node_modules/@material-ui/codemod/lib/v1.0.0/svg-icon-imports.js ./src/
我还为我的文件使用了扩展名 jsx,所以我不得不添加 --extensions 标志:
jscodeshift -t ./node_modules/@material-ui/codemod/lib/v1.0.0/svg-icon-imports.js ./src/ --extensions jsx
| 归档时间: |
|
| 查看次数: |
789 次 |
| 最近记录: |