Installation & Build
There are multiple ways to obtain the bundled dist
files of dash.js for usage in your application.
Bundle formats
Version 4.x and older
In version 4.x and older versions of dash.js there is only one bundle format available. It is a UMD
build that does not contain any polyfills.
Version 5.x and newer
With version 5 of dash.js we introduced three different bundle formats:
UMD legacy
: AUMD
build targeting legacy platforms by specifying the babel targetie: '11'
. In addition,core.js
polyfills are enabled.ESM modern
: AnESM
build using.browserslistrc
as target, with target set todefaults
. Nocore.js
polyfills are enabled.UMD modern
: AUMD
build targeting modern platforms using.browserslistrc
as target, with target set todefaults
. Nocore.js
polyfills are enabled.
All the bundled files are located in the dist
directory of the repository. The legacy
folder inside the dist
folder contains the UMD legacy
build. The modern
folder inside the dist
folder contains both the ESM modern
and the UMD modern
build.
General Note
Note that only the master
branch of dash.js includes the dist
folder. If you are working with the development
branch, you need to build the bundles yourself. For that reason, check the Building the dist
files section below.
CDN hosted files
We provide the latest minified files of all releases on a global CDN. They are free to be used in production environments. An overview of the dash.js releases can be found on GitHub.
Version 4.x and older
All releases prior to version 5.0.0 are available under the following urls. Replace vx.x.x
with the release version, for instance v3.1.0
.
Version 5.x and newer
With version 5.0.0 we introduced new bundle formats. The URLs for the CDN hosted files for these new bundle formats are as follows. Replace vx.x.x
with the release version, for instance v5.0.0
.
UMD legacy
- Minified Build: http://cdn.dashjs.org/vx.x.x/legacy/umd/dash.all.min.js
- Debug Build: http://cdn.dashjs.org/vx.x.x/legacy/umd/dash.all.debug.js
UMD modern
- Minified Build: http://cdn.dashjs.org/vx.x.x/modern/umd/dash.all.min.js
- Debug Build: http://cdn.dashjs.org/vx.x.x/modern/umd/dash.all.debug.js
ESM modern
- Minified Build: http://cdn.dashjs.org/vx.x.x/modern/esm/dash.all.min.js
- Debug Build: http://cdn.dashjs.org/vx.x.x/modern/esm/dash.all.debug.js
Multiple examples how to use dash.js in your Typescript or Webpack based JavaScript project can be found in samples/modules
.
NPM package
We publish dash.js to npm. Examples of how to use dash.js in different module bundlers can be found in the samples/modules
directory of the dash.js repository.
Version 4.x and older
For version 4.x and older, we define the following entry point in the package.json
:
{
"main": "dist/dash.all.min.js"
}
Version 5.x and newer
For version 5.x and newer, we define the following entry points in the package.json
:
{
"types": "./index.d.ts",
"import": "./dist/modern/esm/dash.all.min.js",
"default": "./dist/modern/esm/dash.all.min.js",
"browser": "./dist/modern/umd/dash.all.min.js",
"script": "./dist/modern/umd/dash.all.min.js",
"require": "./dist/modern/umd/dash.all.min.js"
}
Building the dist
files
To build the dist
files of the latest stable release yourself run the following steps:
- Install Core Dependencies
- Checkout project repository (default branch:
development
)git clone https://github.com/Dash-Industry-Forum/dash.js.git
- Change branch to
master
git checkout -b master origin/master
- Install dependencies
npm install
- Build the
dist
files.npm run build