Created
February 17, 2020 01:49
-
-
Save hoiheart/9abbca70e346e471259e9a2b49f6c90b to your computer and use it in GitHub Desktop.
es5 vue plugin (babel.config.json)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = api => { | |
const isTest = api.env('test') | |
return { | |
sourceType: 'unambiguous', // import/ export문이 있으면 파일을 모듈로 간주하도록 설정 | |
presets: [ | |
'@babel/preset-typescript', | |
[ | |
'@babel/preset-env', | |
{ | |
useBuiltIns: 'usage', | |
corejs: 3, | |
// jest 에서는 기본값 'auto' 설정 필요 | |
// false 는 import, export 가 require, module.exports 로 변환이 되지 않게함 | |
modules: isTest ? 'auto' : false | |
} | |
] | |
], | |
plugins: [ | |
'@babel/proposal-class-properties' | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment