mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-04-22 20:38:55 -05:00
fix: should not inject babel-core shim if babel plugin is not used
close #1424
This commit is contained in:
@@ -36,14 +36,16 @@ module.exports = api => {
|
||||
}
|
||||
|
||||
if (!api.hasPlugin('typescript')) {
|
||||
jestConfig.transform['^.+\\.jsx?$'] = 'babel-jest'
|
||||
api.extendPackage({
|
||||
devDependencies: {
|
||||
'babel-jest': '^22.4.3',
|
||||
// this is for now necessary to force babel-jest and vue-jest to use babel 7
|
||||
'babel-core': '7.0.0-bridge.0'
|
||||
}
|
||||
})
|
||||
if (api.hasPlugin('babel')) {
|
||||
jestConfig.transform['^.+\\.jsx?$'] = 'babel-jest'
|
||||
api.extendPackage({
|
||||
devDependencies: {
|
||||
'babel-jest': '^22.4.3',
|
||||
// this is for now necessary to force babel-jest and vue-jest to use babel 7
|
||||
'babel-core': '7.0.0-bridge.0'
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
jestConfig.moduleFileExtensions.unshift('ts', 'tsx')
|
||||
jestConfig.transform['^.+\\.tsx?$'] = 'ts-jest'
|
||||
|
||||
Reference in New Issue
Block a user