Package Exports
- mux-embed
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mux-embed) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Mux Embed
The embed code and included JavaScript file for browser-based analytics tracking.
Setup
Install dependencies
npm install
Prepublish
Build the useable files into the dist
folder, after running linting and tests
npm run build
Publishing
Publishing happens automatically when pull requests are merged into master. See scripts/deploy.js
for specifics.
Be sure to bump the version in the package.json in the PR before merging it.
Testing
To run the tests locally, just run
npm run test
To run the tests through SauceLabs (locally). You must have SAUCE_USERNAME and SAUCE_ACCESS_KEY configured as environment variables:
SAUCELABS=1 npm run test
linting
This uses ESLint for linting, so to run linting standalone, run:
npm run lint
Developing
To watch the lib and test folders for any changes, run lint, test, and build sequentially, and start the server (default port 8080 or first one free after):
npm run start
Files
dist/mux.js
The minified version of mux.js. This file is loaded into the web page by the embed code. For every event that is tracked it will send a beacon to the server. The beacon is simply an image URL with data in the query string.
build/mux.debug.js
The un-minified version of mux.js. Only available for debugging.
Using
See docs.mux.io for usage details (and don't forget to update the docs if you make changes).