-
-
Notifications
You must be signed in to change notification settings - Fork 768
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
Support on-fly browserification with node-browserify #30
Comments
In fact we use browserify:
if test ! `which browserify` ; then npm install browserify ; fi
cp -r support/browserify/ ${TMP_DIR}
browserify index.js -o ${TMP_DIR}/50_js-yaml.js
cat ${TMP_DIR}/* > js-yaml.js
rm -rf ${TMP_DIR}
cp js-yaml.js demo/js/ In other words, we browserify js-yaml with node-browserify and then prepend and append to the result some portions of JavaScript that make us possible to add some browser-specific hacks and enclose everything to provide only one variable into global scope - Please, explain which error you get exactly? |
I installed js-yaml locally and I'm trying to require() it with browserify:
It says:
So at the moment I'm better of to just include the "js-yaml.min" file. Would be simpler to use the npm package in the browser since you can upgrade it (through package.json) once both for server and browser. |
Hm. That's strange. If somebody will point why that might happen - we'll be glad to fix it. And will appreciate patches. But due to limited sources and time we can't handle this issue in the closest future. But the idea is really awesome! |
Just tried it out again it actually worked! I just forgot to require() it in another place of my app. However, it takes browserify 10-15 seconds to concatenate all js-yaml files. But perhaps that is something browserify should get better at. I'm glad that it worked. No need to keep the minified browser file up to date anymore! :) Other people have this problem as well: browserify/browserify#90 |
Would be great if this npm package could be compatible with browserify so we don't have to use the minified version.
https://github.com/substack/node-browserify
At the moment I get an error when using the load() function.
The text was updated successfully, but these errors were encountered: