-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
feat(build): es2015 bundle artifact #6291
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
current status: the two test files from 33d9c54 do not work.
|
* also change config file type from .json to .js
* bundle: re-add StatsWriterPlugin
* mocha test updated for bundled versions
* restore entry point for main * include es scripts to script: build
* output exceeds assetSizeLimits, yields jest errors
This reverts commit 96286e7.
* re-add test:artifact:umd:bundle to test:artifact
tim-lai
force-pushed
the
feat/build-artifacts
branch
from
August 13, 2020 23:59
0f10c7f
to
b06407a
Compare
This was referenced Aug 14, 2020
@tim-lai I noticed that the es module still appears to be using CommonJS format, i.e. module.exports. I guess I expected it to be using 'export XXX' format. Am I missing something? Just wanted to ask you before submitting a bug report.
|
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
build:es:bundle
build:es:bundle
test:artifact
babel.config.json
tobabel.config.js
and maintain env support for commonjs and es2015.jsx
extension inside importremoving the polyfill also reduces bundle size, now down to 956 KiB
Motivation and Context
swagger-ui should be available as an es2015 bundle. This will allow swagger-editor to avoid re-bundling dependencies that it does not directly use, e.g.
highlight.js
.However, swagger-editor still expects swagger-ui to exist as a bundle. Therefore, full tree-shaking is not currently possible.
How Has This Been Tested?
New Jest tests to confirm that production bundles export as a function.
Note: known issue that these Jest tests pass locally on Node 10/12/13, but not on Jenkins. As a result,
test:artifact
is not currently included in thetest
script.swagger-editor build is reduced from 4+ MiB (cjs) to 3.05 MiB (es), even with react-syntax-highlighter.
Screenshots (if appropriate):
Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests