diff --git a/.airtap.yml b/.airtap.yml deleted file mode 100644 index e76fa749b..000000000 --- a/.airtap.yml +++ /dev/null @@ -1,8 +0,0 @@ -providers: - - airtap-playwright -ui: mocha-bdd -browsers: - - name: chromium - supports: - headless: true - diff --git a/README.md b/README.md index 9651eb0f0..bb10453c7 100644 --- a/README.md +++ b/README.md @@ -801,6 +801,8 @@ The callback is called when the packet has been removed. Closes the Store. + + ## Browser @@ -812,7 +814,15 @@ You can find all mqtt bundles versions in `dist` folder: - `mqtt.min.js` - iife format, minified - `mqtt.esm.js` - esm format minified -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' @@ -830,30 +840,6 @@ See for the full documentation on version ranges. **Be sure to only use this bundle with `ws` or `wss` URLs in the browser. Others URL types will likey fail** - - -### 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' -``` - - - -### 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' -``` - ## About QoS diff --git a/examples/vite-example/src/App.vue b/examples/vite-example/src/App.vue index d495e5d1f..668c34a70 100644 --- a/examples/vite-example/src/App.vue +++ b/examples/vite-example/src/App.vue @@ -1,10 +1,12 @@