spaceship

Webpack cheatsheet

This is a list with the web pack cheatsheet to allow developers find the most used things quick

Stefan Izdrail

Freelance developer available for work.

Webpack cheatsheet

This is a list with the web pack cheatsheet to allow developers find the most used things quick

Loading ttf files

Add to module loader in your webpack config file:

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

Loading 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

Production

For using webpack in production

webpack -p

More stories

  • Author Name

    Sed do eiusmod tempor incididunt

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt. READ MORE
  • Author Name

    Sed do eiusmod tempor incididunt

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt. READ MORE
  • Author Name

    Sed do eiusmod tempor incididunt

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt. READ MORE
  • Author Name

    Sed do eiusmod tempor incididunt

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt. READ MORE
  • Author Name

    Sed do eiusmod tempor incididunt

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt. READ MORE
  • Author Name

    Sed do eiusmod tempor incididunt

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt. READ MORE
  • Author Name

    Sed do eiusmod tempor incididunt

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt. READ MORE
  • Laravel Star
    I'm a certified Laravel Developer
  • Availability
    My working hours are from 9 to 5
  • Current Location
    Currently I'm located in London.
  • Happy Clients
    Over 200 clients made happy
  • Support
    Over 100 hours of support

Freelance Developer

Creator of @Lzo Media I am a 30 years old Romanian freelance developer who likes beautiful code and has an adherence to standards & open-source solutions.