Giter VIP home page Giter VIP logo

Comments (4)

coyote4til7 avatar coyote4til7 commented on May 14, 2024

More info (or I think I'm outlining a basic howto...)

I figured out that the examples are meant to be integrated directly into whatever node project you've already got. So, instead of trying to access the browserify example via my already running node project, I accessed it directly (via the port number 9393 it spits out when you start it).

I again get the page with the "foo =" that never has anything follow it. What I do get that seems to be new is that (when I view source), I can click on the js src link in Firefox and see the j.s. in /browserify.js?traverse

from browserify.

coyote4til7 avatar coyote4til7 commented on May 14, 2024

Yet another follow on... assuming this stuff is working (and that there's just some bug in the 'foo' example), what's the next step?

The README notes that "during bundling the package.json of a module or base directory will be read for its name and main fields, which will be used unless those fields are defined in opts."

That implies I have to create a package.json for my modules. The project's package.json doesn't really seem to be what we're talking about. My guess would be that I'm going to do some juju involving listing paths in my server.js and then relist them on the client side, but I'm not sure. Suggestions?

from browserify.

 avatar commented on May 14, 2024

There are two ways to load packages: npm-style with a package.json and recursive traversal style starting at a base dir and wrapping all the javascript and coffee files in it. The first example in the readme shows the base directory functionality and the second example shows how to wrap a module from npm so you can use it browser-side.

If you want to integrate some existing browser-side javascript files with browserify, you'll need to update them for node-style exports where you assign into the exports object. After that just point the base option to browserify at your client source directory.

from browserify.

tadast avatar tadast commented on May 14, 2024

Examples work fine, however if someone does not get it working maybe they do the same mistake as I did at first: I opened index file instead of pointing my browser to http://localhost:9393. I hope it helps someone

from browserify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.