-
Notifications
You must be signed in to change notification settings - Fork 1.4k
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rollup, es6 support? #479
Comments
As far as I understand, this questions revolves around ES6 modules, and not other ES6 features. If this is not the case, please explain. MQTT.js will be based on ES6 modules when it could run on top of any supported version of Node without a transpilation step. Currently this number is zero, so it will probably take a few lts cycles to get there. Anyway, I am very happy of accepting any PRs that would make the integration with rollup easy, as long as it keeps running with no transpilation step on all supported versions of Node. It would be good to see if we can work a reference on how to achieve this. Maybe rollup supports some metadata. |
I wish that I had a good solution, but at the moment, I'm not even able to run a single connect test, because of commonjs' failure to resolve nested dependencies. I have no idea why, and therefore "fishing" for help anywhere I can... See rollup/rollup-plugin-commonjs#134 for further info. Anyways, ty for your reply. |
closing this now. Feel free to open issues if it turns out it's MQTT.js fault. |
I use polymer - based on the current pwa starter kit - and want to integrate mqttjs. As far as i understand (sry, newby in js) with polymer in the default way i'm only able to integrate es6 modules. Is there any plan to support es6 module import or is the answer above still valid? |
Bump. This is definitely problematic. Even with |
I've tried with rollup-plugin-node-builtins and rollup-plugin-node-globals and it's imported but probably due to circular dependencies the [Rollup 2.17.0] compile warning:
[Chrome 83.0.4103.106] calling
Conclusion: |
Did anyone manage to successfully import using rollup or es6 import syntax? |
Ended up with the same workaround as @idbartosz - include the compiled file in script and declare the global var in typescript. Failed miserably trying to get it imported with rollbarjs (and therefor vite) |
seems mqttjs targets only node and not the browser |
At the moment, it is very difficult to get the mqtt module to work with rollup. Therefore, I am wondering when you are going to release this package as es6?
The text was updated successfully, but these errors were encountered: