Skip to content

Commit

Permalink
Adjust and add babel deps/config to match 4DN
Browse files Browse the repository at this point in the history
  • Loading branch information
Bianca-Morris committed Jul 31, 2023
1 parent ea836eb commit 1a3b325
Show file tree
Hide file tree
Showing 3 changed files with 3,499 additions and 1,332 deletions.
16 changes: 12 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@

module.exports = function(api){
api.cache(true);
const modulesEnabled = api.env("test");
api.cache.using(function(){ return process.env.NODE_ENV; });
return {
"presets" : [
// We don't need to convert import/export statements.
// We don't need to convert import/export statements unless in test/Jest environment (as Webpack will handle later; not converting here preserves code-splitting).
// @see https://stackoverflow.com/questions/63563485/how-can-i-preserve-dynamic-import-statements-with-babel-preset-env
[ "@babel/preset-env", { "modules": false } ],
[ "@babel/preset-env", { "modules": modulesEnabled ? "auto" : false } ],
"@babel/preset-react",
],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"babel-plugin-minify-dead-code-elimination"
"babel-plugin-minify-dead-code-elimination",
["@babel/plugin-proposal-decorators", { "legacy": true }],
["@babel/transform-async-to-generator", {
"module": "bluebird",
"method": "coroutine"
}],
["@babel/plugin-proposal-pipeline-operator", { "proposal": "minimal" }],
["@babel/plugin-transform-runtime"],
],
"comments": true
};
Expand Down
Loading

0 comments on commit 1a3b325

Please sign in to comment.