-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: es6 #6720
build: es6 #6720
Conversation
"test:artifact:es" is not yet in CI test due to current error below ... and using
|
update: this change will also necessitate changes to swagger-ui-react build, due to change in module path. |
The PR that changed how we use swagger-client in swagger-ui: #6208 |
@@ -1 +1,2 @@ | |||
dist/ | |||
es/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also add es/
to .gitignore
My conclusion after analysis: swagger-client issuesswagger-client issues will be resolved by adding But this is not a solution to a problem. When swagger-client is out of the way, you will intercept many other similar errors. The reason is that Proposed strategy of ES build fragment testingIn order to propertly test |
I'm pretty sure these changes alone won't produce a valid ESM bundle that can be consumed by other non-Webpack bundlers. The reason is that besides the already mentioned yaml and image imports swagger-ui also uses Webpack's |
@DreierF thanks for the comment. You're right |
Hey folks, running into large bundle sizes for similar reasons. Anything I can do to help with getting this PR merged in? |
Just here to confirm this issue is the same when with
Just like the post of @tim-lai |
@davidroman0O did u find a solution? |
This has been solved in other PRs. Currently we have following package.json mapping: "main": "./dist/swagger-ui.js",
"module": "./dist/swagger-ui-es-bundle-core.js",
"exports": {
"./dist/swagger-ui.css": "./dist/swagger-ui.css",
"./dist/oauth2-redirect.html": "./dist/oauth2-redirect.html",
"./dist/swagger-ui-standalone-preset": "./dist/swagger-ui-standalone-preset.js",
".": {
"import": "./dist/swagger-ui-es-bundle-core.js",
"require": "./dist/swagger-ui.js"
}
}, ./dist/swagger-ui-es-bundle-core.js - is a pure ESM bundle. |
Description
create valid es modules instead of a es-bundle.
Motivation and Context
How Has This Been Tested?
works as 'npm link' to swagger-editor
does NOT work with proposed Jest test
Screenshots (if appropriate):
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests