@akanass/rx-file-upload
Advanced tools
Comparing version 1.2.0 to 2.0.0
@@ -1,1 +0,1 @@ | ||
{"name":"@akanass/rx-file-upload","version":"1.2.0","description":"Library to upload a file in the browser and send it fully or in several chunks to the server.","main":"esm5/rx-file-upload.js","main:esnext":"esm/rx-file-upload.js","unpkg":"bundle/rx-file-upload.umd.min.js","types":"types/index.d.ts","repository":{"type":"git","url":"git@github.com:akanass/rx-file-upload.git"},"publishConfig":{"access":"public"},"author":"Nicolas Jessel <akanass@icloud.com>","license":"MIT","private":false,"bugs":"https://github.com/akanass/rx-file-upload/issues","homepage":"https://github.com/akanass/rx-file-upload#readme","keywords":["Browser","FormData","File","Chunks","Upload","Streams","Async","RxJS","ReactiveX","Observable","Observer","Subject","ES2015","ES2016","ES2017","ES2018","ES2019","ES2020","ESNEXT","ES5","ESM","Typescript"],"dependencies":{"crypto-es":"^1.2.7"},"peerDependencies":{"rxjs":"^7.1.0","tslib":"^2.2.0"}} | ||
{"name":"@akanass/rx-file-upload","version":"2.0.0","description":"Library to upload a file in the browser and send it fully or in several chunks to the server.","main":"bundle/rx-file-upload.js","unpkg":"bundle/rx-file-upload.umd.min.js","types":"types/index.d.ts","repository":{"type":"git","url":"git@github.com:akanass/rx-file-upload.git"},"publishConfig":{"access":"public"},"author":"Nicolas Jessel <akanass@icloud.com>","license":"MIT","private":false,"bugs":"https://github.com/akanass/rx-file-upload/issues","homepage":"https://github.com/akanass/rx-file-upload#readme","keywords":["Browser","FormData","File","Chunks","Upload","Streams","Async","RxJS","ReactiveX","Observable","Observer","Subject","ES2015","ES2016","ES2017","ES2018","ES2019","ES2020","ESNEXT","ES5","ESM","Typescript"],"dependencies":{"crypto-es":"^1.2.7"},"peerDependencies":{"rxjs":"^7.1.0"}} |
@@ -33,7 +33,2 @@ # Rx-File-Upload | ||
* [RxFileUploadError](#rxfileuploaderror) | ||
* [Building for Production](#building-for-production) | ||
* [ES5](#es5) | ||
* [ESNEXT](#esnext) | ||
* [Webpack support](#webpack-support) | ||
* [Rollup support](#rollup-support) | ||
* [License](#license) | ||
@@ -413,65 +408,2 @@ | ||
## Building for Production | ||
Two unbundled versions of this library are offered for your convenience, one targeting `ES5` and a second targeting `ESNEXT`. | ||
### *ES5:* | ||
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**. | ||
**TypeScript** and **JavaScript** codebases alike can import and use this library without any special build configuration considerations. | ||
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**: | ||
```sh | ||
$> npm install --save-dev tslib | ||
or | ||
$> yarn add -D tslib | ||
``` | ||
### *ESNEXT:* | ||
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! | ||
See bundler instructions below. | ||
#### Webpack support | ||
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**: | ||
```js | ||
module.exports = { | ||
//... | ||
resolve: { | ||
mainFields: [ 'main:esnext', 'module', 'main' ], | ||
}, | ||
}; | ||
``` | ||
`'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. | ||
#### Rollup support | ||
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**: | ||
```js | ||
// rollup.config.js | ||
import resolve from 'rollup-plugin-node-resolve'; | ||
export default { | ||
// input: ... | ||
// output: ... | ||
plugins: [ | ||
//... | ||
resolve({ mainFields: [ 'main:esnext', 'module', 'main' ] }), | ||
] | ||
} | ||
``` | ||
`'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. | ||
[back to top](#table-of-contents) | ||
## License | ||
@@ -478,0 +410,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
2
72344
7
373
412
1