Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.