diff --git a/README.md b/README.md index f7b7ce211..5b82d204f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,17 @@ stream transforms for Node & the Web. The primary purpose is to deal with RTP streams in a browser without the need to use plugins or Flash, but relying on the [Media Source Extensions](https://www.w3.org/TR/media-source/) standard, which is supported in all modern browsers. +_Note for IE11 users_: if you want to build the library yourself for IE11 instead +of using the provided bundle, you need import from `dist/es5` with the following fix in webpack: + +``` +alias: { + debug: 'debug/dist/debug.js', +}, +``` + +You can look at the `webpack.config.js` to see how it's used for building the bundle. + ## Structure The library contains a collection of components that can be connected diff --git a/package.json b/package.json index a721e08e1..743d94b21 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,10 @@ "lint": "tslint --project tsconfig.json --format stylish", "test": "jest --coverage", "verify": "yarn lint && yarn test", - "build": "yarn build:esm && yarn build:cjs && yarn build:bundle", + "build": "yarn build:esm && yarn build:cjs && yarn build:es5 && yarn build:bundle", "build:esm": "tsc -p tsconfig.json", "build:cjs": "tsc -p tsconfig.cjs.json", + "build:es5": "tsc -p tsconfig.es5.json", "build:bundle": "webpack", "rtsp": "rtsp-ws-server/start.sh", "dev": "webpack --mode development --watch", diff --git a/tsconfig.es5.json b/tsconfig.es5.json new file mode 100644 index 000000000..161389c83 --- /dev/null +++ b/tsconfig.es5.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + /* Include Typescript declaration files */ + "declaration": true, + + /* Basic Options */ + "target": "es5", + "downlevelIteration": true, + "module": "es2015", + "outDir": "./dist/es5", + "skipLibCheck": true, + "sourceMap": true, + + /* Strict Type-Checking Options */ + "strict": true, + + /* Module Resolution Options */ + "moduleResolution": "node", + "esModuleInterop": true + }, + "include": ["lib/**/*"] +} diff --git a/tsconfig.json b/tsconfig.json index f33d37d3e..e72844adf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { /* Include Typescript declaration files */ "declaration": true, - + /* Basic Options */ "target": "es2015", "module": "es2015", diff --git a/webpack.config.js b/webpack.config.js index ded85f1c1..ddea99a46 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -9,6 +9,12 @@ module.exports = { }, resolve: { extensions: ['.ts', '.js'], + // The debug packages resolves to src/debug.js by default + // which doesn't work on IE11 (it's not ES5), but it seems + // that the dist/debug.js file does work. + alias: { + debug: 'debug/dist/debug.js', + }, }, module: { rules: [