Skip to content

Commit

Permalink
build(deps): remove babel-plugin-transform-es2015-modules-commonjs
Browse files Browse the repository at this point in the history
Remove `babel-plugin-transform-es2015-modules-commonjs`, which is 6 years out-of-date and no longer supported. It generates security warnings in the console, because of outdated dependencies on `@babel/traverse`.

- transpile `.coffee` and `.cjsx` files from CJS to ESM with Babel.
- fix broken `module.exports` in a couple of places.
- `npm audit fix`.
  • Loading branch information
eatyourgreens committed May 31, 2024
1 parent b8cf174 commit 48f2cba
Show file tree
Hide file tree
Showing 7 changed files with 346 additions and 973 deletions.
2 changes: 1 addition & 1 deletion app/pages/lab/field-guide/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,4 @@ var actions = {
}
};

module.exports = actions;
export default actions;
2 changes: 1 addition & 1 deletion app/pages/project/stats/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,4 @@ ProjectStatsPageController.propTypes = {
params: PropTypes.object
};

module.exports = ProjectStatsPageController;
export default ProjectStatsPageController;
25 changes: 1 addition & 24 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = function (api) {
api.cache(true);
return {
sourceType: 'unambiguous',
plugins: [
[
'@babel/plugin-transform-runtime',
Expand All @@ -14,34 +15,10 @@ module.exports = function (api) {
['@babel/preset-react', { runtime: 'automatic' }]
],
env: {
development: {
plugins: [
[
'transform-es2015-modules-commonjs'
]
]
},
staging: {
plugins: [
[
'transform-es2015-modules-commonjs'
]
]
},
production: {
plugins: [
[
'transform-es2015-modules-commonjs'
]
]
},
test: {
plugins: [
[
'babel-plugin-rewire'
],
[
'transform-es2015-modules-commonjs'
]
]
}
Expand Down
Loading

0 comments on commit 48f2cba

Please sign in to comment.