From 531e5d1d73d4b92093cb4a03f40b4f8f997c246d Mon Sep 17 00:00:00 2001 From: Dylan Date: Thu, 8 Jun 2017 12:03:38 -0700 Subject: [PATCH] clarify the two different npm packages available for this repo --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 769cbe868fc..5bc5f2cbf7f 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ As a brand new version, written from the ground up, there are some known issues and unimplemented features. Check out the [Known Issues](#known-issues) section for more details. +This repo publishes to two different NPM packages: + +* [swagger-ui](https://www.npmjs.com/package/swagger-ui) is intended for use as a node module. +* [swagger-ui-dist](https://www.npmjs.com/package/swagger-ui-dist) comes pre-bundled with all dependencies and can be incorporated directly in a webapp. + For the older version of swagger-ui, refer to the [*2.x branch*](https://github.com/swagger-api/swagger-ui/tree/2.x). ## Compatibility @@ -59,6 +64,11 @@ To help with the migration, here are the currently known issues with 3.X. This l - l10n (translations) is not implemented. - Relative path support for external files is not implemented. +### Direct use of JS and CSS assets +To include the JS, CSS and image assets directly into a webpage, use the [swagger-ui-dist](https://www.npmjs.com/package/swagger-ui-dist) package. +The root directory of this package contains the contents of the _dist/_ directory of this repo. +As a node module, `swagger-ui-dist` also exports the `swagger-ui-bundle` and `swagger-ui-standalone-preset` objects. + ### SwaggerUIBundle To use swagger-ui's bundles, you should take a look at the [source of swagger-ui html page](https://github.com/swagger-api/swagger-ui/blob/master/dist/index.html) and customize it. This basically requires you to instantiate a SwaggerUi object as below: