Skip to content

Instantly share code, notes, and snippets.

@chrisalexander55
Last active September 29, 2017 18:27
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisalexander55/81f3d5db057fbcbd74d62d488adbca8a to your computer and use it in GitHub Desktop.
Save chrisalexander55/81f3d5db057fbcbd74d62d488adbca8a to your computer and use it in GitHub Desktop.
Subtle Tweak to get Boostrap 4 Working With Webpack

Although I followed the excellent directions provided by the Boostrap 4 documentation, I found it incomplete. Here are the missing steps:

# install dependencies
npm i jquery popper.js bootstrap@4.0.0-beta --save

# install dev-dependencies
npm i precss --save-dev

# use the following webpack postcss-loader config
{
  loader: 'postcss-loader', // Run post css actions
  options: {
    sourceMap: true, // if other loaders generate sourceMap file(s)
    plugins: function () { // post css plugins, can be exported to postcss.config.js
      return [
        require('precss'),
        require('autoprefixer')
      ];
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment