fix: Export ./dist/swagger-ui.css #7878
Merged
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
This PR corrects the CSS export in
package.json
from./swagger-ui.css
to./dist/swagger-ui.css
.Motivation and Context
v4.6.0 has an incorrect export in
package.json
for./dist/swagger-ui.css
which causes the following error when importing the file:How Has This Been Tested?
This was tested in our Vue SPA which imports swagger-ui by switching to our fork and changing the export to the correct path for the CSS file. With the path in v4.6.0, the application doesn't build at all, whereas with the corrected path, it all works again.
Changing the import from
import 'swagger-ui/dist/swagger-ui.css';
toimport 'swagger-ui/swagger-ui.css';
results inModule not found: Error: Can't resolve 'swagger-ui/swagger-ui.css'
, whereas fixing the export inpackage.json
results in the original import line working, thus I believe this is the correct fix for the issue.Checklist
My PR contains...
src/
is unmodified: changes to documentation, CI, metadata, etc.)package.json
)My changes...
Documentation
Automated tests
(I don't think this really needs a test, since it's just a broken export.)