You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Building for Production](#building-for-production)
34
-
*[ES5](#es5)
35
-
*[ESNEXT](#esnext)
36
-
*[Webpack support](#webpack-support)
37
-
*[Rollup support](#rollup-support)
38
33
*[License](#license)
39
34
40
35
## Installation
@@ -409,69 +404,6 @@ Represents the error response, from the server, streamed by the `Observable`, du
409
404
410
405
[back to top](#table-of-contents)
411
406
412
-
## Building for Production
413
-
414
-
Two unbundled versions of this library are offered for your convenience, one targeting `ES5` and a second targeting `ESNEXT`.
415
-
416
-
### *ES5:*
417
-
418
-
The `ES5` version is suitable for use when **deprecated browsers** like `IE10+` or `Edge Legacy` need to be supported. This version is also the **default** version that gets pulled in as the `"main"` entry in **package.json**.
419
-
420
-
**TypeScript** and **JavaScript** codebases alike can import and use this library without any special build configuration considerations.
421
-
422
-
However, you will need to ensure that the `tslib@^2.2.0` dependency gets pulled into your build artifact then you will need to install this package **manually** by adding it to `devDependencies` in your project's **package.json**:
423
-
424
-
```sh
425
-
$> npm install --save-dev tslib
426
-
427
-
or
428
-
429
-
$> yarn add -D tslib
430
-
```
431
-
432
-
### *ESNEXT:*
433
-
434
-
The `ESNEXT` version is suitable for use when only **modern browsers** need to be supported. **TypeScript** and **JavaScript** codebases alike can import and use this library. However, you will need to ensure that your bundler pulls in the `ESNEXT` version of the library when building your application!
435
-
436
-
See bundler instructions below.
437
-
438
-
#### Webpack support
439
-
440
-
No matter the `"target"` of your build you'll need to indicate additional files for webpack to resolve via the [`"resolve.mainFields"`](https://webpack.js.org/configuration/resolve/#resolvemainfields) property in your config. Resolve the `"main:esnext"` field defined in **package.json**:
441
-
442
-
```js
443
-
module.exports= {
444
-
//...
445
-
resolve: {
446
-
mainFields: [ 'main:esnext', 'module', 'main' ],
447
-
},
448
-
};
449
-
```
450
-
451
-
`'main:esnext'` must come first in the list to ensure that the `ESNEXT` version of this library is bundled. Additional values can be added afterwards as needed.
452
-
453
-
#### Rollup support
454
-
455
-
Add the [`@rollup/plugin-node-resolve`](https://github.com/rollup/rollup-plugin-node-resolve#usage) plugin to your Rollup config to read in the `"main:esnext"` field from **package.json**:
`'main:esnext'` must come first in the list to ensure that the `ESNEXT` version of this library is bundled. Additional values can be added afterwards as needed.
0 commit comments