Skip to content

Commit c42acfc

Browse files
authored
feat(babel): transform preset names in the plugin migrator (#4629)
1 parent c53a49d commit c42acfc

File tree

13 files changed

+100
-10
lines changed

13 files changed

+100
-10
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ packages/test
44
temp
55
entry-wc.js
66
dist
7+
__testfixtures__
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
presets: [
3+
["@vue/app", {
4+
polyfills: []
5+
}]
6+
]
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
presets: [
3+
["@vue/cli-plugin-babel/preset", {
4+
polyfills: []
5+
}]
6+
]
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["@vue/app"]
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ["@vue/cli-plugin-babel/preset"]
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const config = {
2+
presets: [
3+
[require("@vue/babel-preset-app"), {
4+
polyfills: []
5+
}]
6+
]
7+
}
8+
9+
module.exports = config
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const config = {
2+
presets: [
3+
[require("@vue/cli-plugin-babel/preset"), {
4+
polyfills: []
5+
}]
6+
]
7+
}
8+
9+
module.exports = config
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [`@vue/app`]
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [`@vue/cli-plugin-babel/preset`]
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
jest.autoMockOff()
2+
3+
const { defineTest } = require('jscodeshift/dist/testUtils')
4+
5+
defineTest(__dirname, 'usePluginPreset', null, 'default')
6+
defineTest(__dirname, 'usePluginPreset', null, 'customConfig')
7+
defineTest(__dirname, 'usePluginPreset', null, 'require')
8+
defineTest(__dirname, 'usePluginPreset', null, 'templateLiteral')
9+

0 commit comments

Comments
 (0)