first commit

This commit is contained in:
2026-09-08 20:28:54 +08:00
commit 2ada8d3d5a
37380 changed files with 4886169 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
module.exports = function (fileInfo, api) {
const j = api.jscodeshift
const root = j(fileInfo.source)
const useDoubleQuote = root.find(j.Literal).some(({ node }) => node.raw.startsWith('"'))
root
.find(j.Literal, { value: '@vue/app' })
.replaceWith(j.stringLiteral('@vue/cli-plugin-babel/preset'))
root
.find(j.Literal, { value: '@vue/babel-preset-app' })
.replaceWith(j.stringLiteral('@vue/cli-plugin-babel/preset'))
const templateLiterals = root
.find(j.TemplateLiteral, {
expressions: { length: 0 }
})
templateLiterals
.find(j.TemplateElement, {
value: {
cooked: '@vue/app'
}
})
.closest(j.TemplateLiteral)
.replaceWith(j.stringLiteral('@vue/cli-plugin-babel/preset'))
templateLiterals
.find(j.TemplateElement, {
value: {
cooked: '@vue/babel-preset-app'
}
})
.closest(j.TemplateLiteral)
.replaceWith(j.stringLiteral('@vue/cli-plugin-babel/preset'))
return root.toSource({
lineTerminator: '\n',
quote: useDoubleQuote ? 'double' : 'single'
})
}