Comparing version 5.2.0 to 5.2.1
{ | ||
"name": "mqtt", | ||
"description": "A library for the MQTT protocol", | ||
"version": "5.2.0", | ||
"version": "5.2.1", | ||
"contributors": [ | ||
@@ -24,2 +24,3 @@ "Adam Rudd <adamvrr@gmail.com>", | ||
"main": "./build/mqtt.js", | ||
"module": "./dist/mqtt.esm.js", | ||
"bin": { | ||
@@ -39,3 +40,9 @@ "mqtt_pub": "./build/bin/pub.js", | ||
"exports": { | ||
".": "./build/mqtt.js", | ||
".": { | ||
"browser": { | ||
"import": "./dist/mqtt.esm.js", | ||
"default": "./dist/mqtt.js" | ||
}, | ||
"default": "./build/mqtt.js" | ||
}, | ||
"./package.json": "./package.json", | ||
@@ -100,3 +107,3 @@ "./*.map": "./build/*.js.map", | ||
"browser": { | ||
"./mqtt.js": "./build/mqtt.js", | ||
"./mqtt.js": "./dist/mqtt.js", | ||
"fs": false, | ||
@@ -116,2 +123,3 @@ "tls": false, | ||
"minimist": "^1.2.8", | ||
"mqtt": "^5.2.0", | ||
"mqtt-packet": "^9.0.0", | ||
@@ -118,0 +126,0 @@ "number-allocator": "^1.0.14", |
@@ -804,2 +804,4 @@ # ![mqtt.js](https://raw.githubusercontent.com/mqttjs/MQTT.js/137ee0e3940c1f01049a30248c70f24dc6e6f829/MQTT.js.png) | ||
<a name="browser"></a> | ||
<a name="webpack"></a> | ||
<a name="vite"></a> | ||
@@ -816,5 +818,13 @@ ## Browser | ||
In order to import them use one of the following: | ||
Starting from MQTT.js > 5.2.0 you can import mqtt in your code like this: | ||
```js | ||
import mqtt from 'mqtt' | ||
``` | ||
This will be automatically handled by your bundler. | ||
Otherwise you can choose to use a specific bundle like: | ||
```js | ||
import * as mqtt from 'mqtt/dist/mqtt' | ||
@@ -835,26 +845,2 @@ import * as mqtt from 'mqtt/dist/mqtt.min' | ||
<a name="webpack"></a> | ||
### Webpack | ||
If you are using webpack simply import MQTT.js in one of the following ways: | ||
```js | ||
import * as mqtt from 'mqtt/dist/mqtt' | ||
import * as mqtt from 'mqtt/dist/mqtt.min' | ||
import mqtt from 'mqtt/dist/mqtt.esm' | ||
``` | ||
<a name="vite"></a> | ||
### Vite | ||
If you are using vite simply import MQTT.js like this: | ||
```js | ||
import * as mqtt from 'mqtt/dist/mqtt' | ||
import * as mqtt from 'mqtt/dist/mqtt.min' | ||
import mqtt from 'mqtt/dist/mqtt.esm' | ||
``` | ||
<a name="qos"></a> | ||
@@ -861,0 +847,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2037301
17
927
+ Addedmqtt@^5.2.0