Skip to content

React-Native support #573

Closed
Closed
@franleplant

Description

@franleplant

Hi There!

Thanks a lot for your work on this amazing library.

I've been fighting a lot with the browser builds, for several reasons:

  • Im using React Native and I need to manually create a dist file
  • Im using Typescript and I cannot include that dist file in my source because Typescript will complain no end
  • I tried other libraries and frankly this one is the best one
  • Playing around with node_modules is no good, there's no easy solution for automating steps inside that directory and it's also a transient directory, I don't want to get too attached to it in the case I need to rm -rf node_modules, which is too often

So, that's my problem, and here is my solution, which aims to be as simple as it gets

  • Add dist/mqtt.js to the source files, so I can easily require(mqtt/dist/mqtt). Names can be discussed but the important thing is to have that file available

There are other variations of this solution but I think this works and it's super simple and you already got the script to generate those dist files, the only remaining thing to do would be to un-ignore dist and to fix all the pre-commit checks that fail on those dist files

What do you think?

There might be more fancy solutions and Im open to anything but this requires minimal work and provides maximum satisfaction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions