Skip to content

Commit c575324

Browse files
authored
feat(swagger-ui-react): es module (#6303)
1 parent d521b8c commit c575324

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

flavors/swagger-ui-react/release/run.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ mkdir -p ../dist
1010

1111
# Copy UI's dist files to our directory
1212
cp ../../../dist/swagger-ui.js ../dist
13+
cp ../../../dist/swagger-ui-es-bundle.js ../dist
1314
cp ../../../dist/swagger-ui.css ../dist
1415

1516
# Create a releasable package manifest
1617
node create-manifest.js > ../dist/package.json
1718

1819
# Transpile our top-level component
19-
../../../node_modules/.bin/babel --config-file ../../../babel.config.json ../index.js > ../dist/index.js
20+
../../../node_modules/.bin/cross-env BABEL_ENV=commonjs ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.js > ../dist/commonjs.js
21+
../../../node_modules/.bin/cross-env BABEL_ENV=es ../../../node_modules/.bin/babel --config-file ../../../babel.config.js ../index.js > ../dist/index.js
2022

2123
# Copy our README into the dist folder for npm
2224
cp ../README.md ../dist

flavors/swagger-ui-react/release/template.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"$remove": true
2727
},
2828
"name": "swagger-ui-react",
29-
"main": "index.js",
29+
"main": "commonjs.js",
30+
"module": "index.js",
3031
"repository": "[email protected]:swagger-api/swagger-ui.git",
3132
"contributors": [
3233
"(in alphabetical order)",

0 commit comments

Comments
 (0)