In this example, the base VM will use the HTML structure as defined in ‘index.html’ as it’s V. Note that the ‘script’ referenced isn’t ‘app.js’ but ‘main.js’, this is because we are using ‘watchify’ as a ‘module bundler/build tool’ during the development of this app.
THE PRACTICAL GUIDE TO BUILDING DATA DRIVEN WEB APPS WITH VUE.JS
muyiwa akin-ogundeji
182

Ok, that was an ‘oops’… You wrote “Watchify denotes Browserify is the module builder which uses main.js as entry point. So app.js is for webpack builds?”

You are correct in surmising that Watchify denotes that Browserify is the module builder. However, app.js is the actual script we create, it’s bundled out as ‘main.js’. This bundling allows us to write in ‘Node.js’ style CommonJS syntax using ‘require()’ etc.

The bundled output is what the browser parses and not the original ‘app.js’.

Per webpack, i haven’t used it much really, but my understanding is that yo can pretty much achieve the same results using either webpack or browserify.

I hope this clarifies things.

If there’s any way i can be of assistance to you on Vue.js, Node.js and other areas, please reach out to me. Cheers.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.