koa2 webpack boilerplate
A simple koa2 boilerplate based on webpack3
Features
This is a koa2 starter boilerplate app I've put together using the following technologies:
✓ koa v2
✓ ES2015+
✓ Babel
✓ SCSS
✓ Eslint
Usage
Step 1. Make sure that you have Node.js v6 or newer and npm installed on your development machine.
- node
^6.0.0
- npm
^5.0.0
Step 2. Clone this repository
$ git clone git@github.com:chenbin92/koa2-webpack-boilerplate.git MyApp
$ cd MyApp
$ npm install # Install project dependencies listed in package.json
If you just want to start a new project without the koa2 webpack boilerplate
commit history then you can do:
$ git clone --depth=1 git@github.com:chenbin92/koa2-webpack-boilerplate.git MyApp
The depth=1 tells git to only pull down one commit worth of historical data.
Step 3. Compile and launch your app by running:
$ npm run start:dev # Compiles the app and opens it in a browser with "hot reload"
Now the app should be running at http://0.0.0.0:3000/
Build
A build
script to bundle JS, CSS, and images for production, with sourcemaps.
$ npm run build
Scripts
npm <script> |
Description |
---|---|
star:dev |
Serves your app at localhost:3000 |
star:prod |
Serves your app at localhost:3000 |
build |
Builds the application |
lint |
Lints the project for potential errors |