Webpack cheatsheet

Loading ttf files

Add to module loader in your webpack config file:

{
    test   : /\.(ttf|eot|svg|woff(2)?)(\?[a-z0-9=&.]+)?$/,
    loader : 'file-loader'
}

Loadding css files

{
test: /\.css$/,
loader: "style-loader!css-loader"
},

Making jQuery available globally

 plugins: [
new webpack.ProvidePlugin({
  jQuery: 'jquery',
  $: 'jquery',
  jquery: 'jquery',
  '_': 'lodash'
})
]

Loading Bootstrap

In your root .js file:

import 'Bootstrap'
import 'bootstrap/dist/css/bootstrap.css'

Running

Create dev files and watch for changes

webpack --watch

Create distribution/public files

webpack -p

really good guide here