Giter VIP home page Giter VIP logo

webpack-config's Introduction

Webpack 5 Configuration

This is my personal webpack v4 configuration, that I am using for small static projects. Feel free to contribute, improve or use it for your projects.

Contains some neat stuff out of the box!

  • jQuery
  • Bootstrap with Popper.js
  • FontAwesome

What does this configuration handles?

Common for development & production environment

  • it accepts two entry points; one for the app and one for the vendor
  • it compiles everything with relative paths, rather than absolute
  • it compiles sass/scss to the css file
  • it compiles es6 to the syntax that every browser can understand
  • it contains latest Boostrap, but with entirely modular setup; you may include only the parts that you need, as you probably won't use 70% of the framework
  • it has alias as ~ for importing your js files, no more mess with directory back-levels

Development environment

  • it runs webpack-dev-server with browser-sync support
  • it builds source-maps

Production environment

  • it minifies js
  • it minifies multiple image types (gif, png, jpg, jpeg, svg)
  • it copies all web fonts
  • it minifies all json files from data directory
  • it has subresource-integrity
  • it does not build source-maps, but you may specify it on line 216 if you want them

Commands?

It's pretty easy... You do not have a bunch of commands, just two of them:

  • npm run serve โ€“ to start with development
  • npm run build - to make it ready for production use

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.