GithubHelp home page GithubHelp logo

boilerplate-webpack-babel's Introduction

boilerplate-webpack-babel

๐Ÿด Starter with Webpack & Babel.js

Features

  • โœ… Webpack
  • โœ… Babel (Core)
  • โœ… Support syntax ES2015+
  • โœ… Static directory dist/
  • โœ… Development with webpack-dev-server
  • โœ… Hosting with http-server
  • โœ… Bundle file size analytics with webpack-bundle-analyzer
  • โœ… Two build strategies: dev (with source maps) & prod (compress file)

Getting started

You can start in two ways:

Use Git

mkdir PROJECT_NAME
cd $_     # Note: "$_" is the last argument of the previous command
git init  # Note: branch "master" is created
git remote add boilerplate [email protected]:piecioshka/boilerplate-webpack-babel.git
git pull boilerplate master
git remote remove boilerplate

or ...

Use Zip

  1. Download package file: https://github.com/piecioshka/boilerplate-webpack-babel/archive/master.zip
  2. Extract it to your project directory.

How to build an application?

npm run build               # Development mode
npm run build:development   # Development mode
npm run build:production    # Production mode

Open dist/ directory in browser by npm start.

How to develop an application?

npm run dev     # Use webpack-dev-server
npm run watch   # Use webpack -w

Open dist/ directory in browser by npm start.

Remove generated directory

npm run clear       # Remove only dist/
npm run clear:all   # Remove dist/ & node_modules/

๐Ÿงช Analysis of bundle file weight

If you would like to check how much a bundle file weight:

npm run build:development -- --env addons=bundleanalyzer
npm run build:production -- --env addons=bundleanalyzer

๐Ÿงฉ Webpack Addons

When would you like a modified Webpack configuration, please add a new "addon" to webpack/addons/ directory.

Each addon will be merge via webpack-merge.

See examples:

How to run addons?

npm run build:development -- --env addons=singleAddon
npm run build:production -- --env addons=firstAddon,secondAddon

License

The MIT License @ 2017-2022

boilerplate-webpack-babel's People

Contributors

dependabot[bot] avatar piecioshka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

boilerplate-webpack-babel's Issues

Invalid configuration error

Tried the repo today and at npm run build got:

Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.output.path: The provided value "./public/dist" is not an absolute path!

MacBook Pro Sierra 10.12.3

Looks like this can be solved using __dirname instead of ./ on line 10 of webpack.config.js:

path: __dirname + '/public/dist'

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.