-
Notifications
You must be signed in to change notification settings - Fork 38
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
Check if the library is usable in the browser #57
Comments
I'm really enjoying this library so far. Simple, yet complex :) I am running into trouble importing the brackets-manager into a Vue.js application. The viewer is fine. It was giving me an error compiling the JsonDB.js file (error below). I'm curious if anyone has been able to run the brackets-manager project inside a browser app, and if so what their bable/etc. configuration was to make that possible. Thanks!
|
Hi! It's becoming complex indeed... although I didn't want to. About the JsonDB.js file, it's must be because it uses Node.js modules to read/write from/into files. You should take a look at brackets-viewer.js which now imports the manager as a dependency and compiles it with webpack. It was not implemented by me (the addition of the dependency) so I may not be able to help you with this. I think there is a better way to write the webpack config too, but it works. |
Interesting. I saw that the example file uses the manager magically as part of the window object, but somehow the way I am importing the viewer in Vue.js doesn't provide the brackets-manager object. I'll keep digging around though. There must be a way! Thanks again |
Maybe you should double check that the version of the viewer you are importing is the latest one. The latest npm version (1.4.1) doesn't have the dependency yet. It was added after this. And I don't want to (and can't right now because my computer is broken) to publish a new version right now, because I'd like to do some changes before this. So either import the viewer with CDN links or with a GitHub link to this project in your "dependencies": {
"brackets-viewer": "github:Drarig29/brackets-viewer.js"
} |
That was it! Thanks :) I couldn't get imports to work right so I just downloaded the latest min.js file and that works. |
I removed |
Currently, I always use the library with Node.js.
I want the library to be usable in the browser too: need to ensure that.
The text was updated successfully, but these errors were encountered: