From 70b01404a77e0a4ee69304951cd951369b1db5ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Gorej?= Date: Tue, 5 Sep 2023 15:17:06 +0200 Subject: [PATCH] fix(swagger-ui-react): fix build scripts and allow releasing (#9191) Refs https://github.com/swagger-api/swagger-ui/releases/tag/v5.6.0 --- babel.config.js | 16 ++++++++++++++++ flavors/swagger-ui-react/release/run.sh | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/babel.config.js b/babel.config.js index 510e8189..369863e2 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 b45cf9bc..deeb1e20 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