Skip to content

Instantly share code, notes, and snippets.

@gtzilla
Created September 14, 2019 12:42
Show Gist options
  • Save gtzilla/a6ae9777a987df1ee1357df51bf9cd61 to your computer and use it in GitHub Desktop.
Save gtzilla/a6ae9777a987df1ee1357df51bf9cd61 to your computer and use it in GitHub Desktop.
An example of the new babel.config.js.
'use strict'
/**
babel.config.js with useful plugins.
*/
module.exports = function(api) {
api.cache(true);
api.assertVersion("^7.4.5");
const presets = [
[
"@babel/preset-env", {
"targets": {
"esmodules": true,
"node":true
}
}
]
];
const plugins = [
['@babel/plugin-transform-modules-commonjs'],
['@babel/plugin-transform-destructuring'],
['@babel/plugin-proposal-class-properties'],
['@babel/plugin-proposal-decorators',{
'decoratorsBeforeExport':true
}],
['@babel/plugin-proposal-export-default-from'],
['@babel/plugin-proposal-export-namespace-from'],
['@babel/plugin-proposal-object-rest-spread'],
['@babel/plugin-transform-template-literals'],
['@babel/plugin-proposal-pipeline-operator',{"proposal":"minimal"}],
['@babel/plugin-transform-runtime'],
['@babel/plugin-transform-classes']
];
return {
presets,
plugins
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment