Skip to content
Edward Silverton edited this page Jan 24, 2018 · 34 revisions

Deploying

Here is an example project to help you understand how to deploy the UV: https://github.com/UniversalViewer/uv-app-starter/blob/gh-pages/index.html

You can see a few dependencies being included:

  • uv/uv.css is just some simple styles for the div containing your UV instance to give it a black background with a "spinner".

  • uv/lib/offline.js is all of these dependencies concatenated (jQuery, CoreJS, and JSViews) You could use a CDN for these instead if you prefer. It's called 'offline' because it allows the UV to work using protocols like IPFS where you're loading everything over a different network to the web.

  • uv/helpers.js wraps up some boilerplate code for managing resizing, full screen, and UV event listeners/handlers.

  • uv/uv.js is the compiled UV code, in debug or distribution context depending on if grunt build or grunt build --dist were used respectively. Include this script at the bottom of your page to avoid problems around the uvLoaded event being fired too early.

All of these scripts are copied into your examples/uv folder on build.

Config

  • root: string

    The path to the uv directory. Use a relative path e.g. root: '../../uv'

  • configUri: string

    The relative path to your config json

Distribution

Ensure you have git tagging on version disabled:

npm config set git-tag-version=false

On npm version, info.json is created in /examples/uv with the new version number.

This only works on Windows at present. But you can change the npm script to use $npm_package_version instead of %npm_package_version%

In universalviewer

grunt build --dist

cd examples

npm version major/minor/patch
git add -A
git commit -m "message"
git push origin gh-pages
npm publish --tag beta

Gotchas

UV not appearing in IE

If you have another file called uv.js it can result in this bug: https://github.com/requirejs/requirejs/issues/518