diff --git a/babel.config.js b/babel.config.js index 510e8189c76..369863e227e 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,21 @@ module.exports = { "env": { + "commonjs": { + "presets": [ + [ + "@babel/preset-env", + { + "debug": false, + "modules": "commonjs", + "loose": true, + "targets": "maintained node versions", + "forceAllTransforms": false, + "ignoreBrowserslistConfig": true, + } + ], + "@babel/preset-react", + ], + }, "esm": { "presets": [ [ diff --git a/flavors/swagger-ui-react/release/run.sh b/flavors/swagger-ui-react/release/run.sh index b45cf9bc78c..deeb1e20957 100755 --- a/flavors/swagger-ui-react/release/run.sh +++ b/flavors/swagger-ui-react/release/run.sh @@ -25,7 +25,7 @@ node create-manifest.js > ../dist/package.json # Transpile our top-level component ../../../node_modules/.bin/cross-env BABEL_ENV=commonjs ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.jsx > ../dist/index.cjs -../../../node_modules/.bin/cross-env BABEL_ENV=es ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.jsx > ../dist/index.mjs +../../../node_modules/.bin/cross-env BABEL_ENV=esm ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.jsx > ../dist/index.mjs # Copy our README into the dist folder for npm cp ../README.md ../dist