Skip to content

Latest commit

 

History

History
21 lines (18 loc) · 761 Bytes

File metadata and controls

21 lines (18 loc) · 761 Bytes

Lesson: Webpack Loaders

Transpiling ES6 to ES5

  1. Create webpack config and define entry file and bundle path
  2. Install babel-loader, @babel/preset-env, @babel/core as dev dependency
  3. Add babel-loader to webpack config
  4. Adjust npm script "build"
  5. Generate bundle with webpack
  6. Confirm that bundle is ES5 code

Import Bootstrap CSS

  1. Import css files (style.css & bootstrap) into app.js
  2. Add style / css loaders (check webpack loaders page)
  3. Configure that css files are handled

Use dist folder

  1. Configure dist folder output
  2. Add html-webpack-plugin
  3. Configure html webpack plugin to create html file in dist folder using a template

Documentation

https://github.com/babel/babel-loader