Skip to content
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

One Single source JS file to be used in browsers #19

Open
gandhirajan opened this issue Nov 4, 2016 · 5 comments
Open

One Single source JS file to be used in browsers #19

gandhirajan opened this issue Nov 4, 2016 · 5 comments

Comments

@gandhirajan
Copy link

Hi, Is it possible to get single JS file with the complete source that do not require nodejs depedency to be used in the browser by including it in HTML? Is it possible by any chance?

@touv
Copy link
Collaborator

touv commented Nov 4, 2016

To have a file for browsers use, I use browserify. You can try it.

@gandhirajan
Copy link
Author

gandhirajan commented Nov 4, 2016

Hi Nicolas, i tried the following:

  1. Downloaded xml-writer.js from lib folder
  2. Browserified the same using the command: browserify xml-writer.js -o xml-writer-browser.js
  3. Included xml-writer-browser.js file in my code.

But I am getting the error: "uncaught ReferenceError: XMLWriter is not defined(…)" while try to instantiate XMLWriter. What am i missing? Please advice

Also if i try using xml-writer.js as is by commenting out the line - "module.exports = XMLWriter;" it works fine. Does that mean this file is already browserified?

@siddharthnaik7
Copy link

Hi @gandhirajan ,

I am also getting the error: "uncaught ReferenceError: XMLWriter is not defined(…)" while try to instantiate XMLWriter.
Did you happen to find any solutions for this error?

Thanks - Siddharth

@gandhirajan
Copy link
Author

@siddharthnaik7 , we were planning to use this earlier for xml building but later decided to use this - https://github.com/oozcitak/xmlbuilder-js So i m not sure whether someone managed to resolve this.

@siddharthnaik7
Copy link

@gandhirajan thanks for your input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants