Advanced Builds with Webpack

Organizing Files and Folders

Joe explains that most developers don’t like to check in files in the build folder into source control.

It would be nice if we could get out bundle.js to go into a special directory that we could set to ignore inside of our source control, but still serve it from a directory that makes sense, for example:

public/assets/js/bundle.js

Joe show us how to do exactly this, using the path and publicPath keys inside our output configuration.

Working with ES6 Modules

This course uses the term ES6 to mean JavaScript based on the EcmaScript 2015 standard.

Previously we used the CommonJS syntax for requiring modules e.g.:

require(‘./login’)

This is equivalent to this ES6 syntax:

import {} from ‘./login’

Joe updates the file extension from .js to .es6 so that webpack knows to process it as an ES6 file.