blade254353074 / webpack-learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Webpack Learning

This repo is a collection of simple demos of Webpack.

Links

Documents

  • Webpack CLI 文档
    • Development webpack -d === webpack --debug --devtool source-map --output-pathinfo
    • Production webpack -p === webpack --optimize-minimize --optimize-occurence-order
    • Watch mode webpack --watch
  • Webpack Config 文档

How to use

First, install Webpack and webpack-dev-server globally.

$ npm i -g webpack webpack-dev-server

Then, clone the repo and install the dependencies.

$ git clone https://github.com/blade254353074/webpack-learning.git
$ cd webpack-learning
$ npm install

Now, play with the source files under the repo's demo* directories.

$ cd demo*
$ webpack-dev-server

open http://localhost:8080/webpack-dev-server/bundle in browser to watch auto update

final

$ cd final

# for production
$ webpack -d

# or for development
$ node app.js
# then open http://localhost:3000/webpack-dev-server/ in your browser

then open http://localhost:3000/

About


Languages

Language:JavaScript 95.7%Language:HTML 4.2%Language:CSS 0.1%