Closed vojty closed 3 years ago
Hey Tomáš, thanks for putting this pull request together. I had been working on something similar to this, but I wasn't sure I had the correct rollup settings. I've checked in what I have so far and updated the CodePen examples. You now only need to include the UMD and initialize the WebAssembly module using:
await ImGui.default();
I'm not sure, what has just happened in master branch :) The point of this PR was to provide en ES build (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), so you could use it with import/export (which is quite common these days) and have type declaration files too.
You can keep UMD build as well, so anybody can easily play with it just by linking the url, that's fine.
The files in the build
directory are "polluted" by SystemJS and the imgui_impl
is missing (which seems to me to be quite necessary)
obsolete -> closing
@flyover I'm sure you are busy, but are you interested in something like this in the future or not? I don't really want to maintain a fork just for the different build system...
Hello, I tried to use this package with webpack and ended up with this.
Here is what I changed:
src
directorydist
directory)example/imgui_impl
tosrc/imgui_impl_webgl
since it's something you kinda need to use in the browser.main.js
now.Example usage
I know this might be a little bit controversial change, but I believe the most of the users just want to simply type
yarn add imgui-js
(without any compiling & building) and let them decided, what module system they want to use.It would be nice to publish this as an NPM package eventually.
I see that the codepen examples are using SystemJS too, I'll be happy to convert them as well. Please let me know what do you think and if it's the way you want to go or not. Thanks