index.js 716 B

123456789101112131415161718192021222324
  1. const { chalk } = require('@vue/cli-shared-utils')
  2. module.exports = api => {
  3. api.transformScript(
  4. 'babel.config.js',
  5. require('../codemods/usePluginPreset')
  6. )
  7. if (api.fromVersion('^3')) {
  8. api.extendPackage(
  9. {
  10. dependencies: {
  11. 'core-js': '^3.8.3'
  12. }
  13. },
  14. { warnIncompatibleVersions: false }
  15. )
  16. // TODO: implement a codemod to migrate polyfills
  17. api.exitLog(`core-js has been upgraded from v2 to v3.
  18. If you have any custom polyfills defined in ${chalk.yellow('babel.config.js')}, please be aware their names may have been changed.
  19. For more complete changelog, see https://github.com/zloirock/core-js/blob/master/CHANGELOG.md#300---20190319`)
  20. }
  21. }