October 2017
Intermediate to advanced
302 pages
7h 27m
English
Let's take a look at how Webpack combines our JavaScript files together. Go through the following steps to add a second JavaScript file:
console.log(‘Hello from index2.js!’);
require('./index2.js');console.log('Hello from index.js!');
This basically means that index.js now tells Webpack, "Hey, I need this other index!"
node_modules/.bin/webpack src/index.js public/bundle.js
Again, we’ll only specify src/index.js, but if you look at the console output, you’ll see ...
Read now
Unlock full access