• Stars
    star
    176
  • Rank 210,580 (Top 5 %)
  • Language
    JavaScript
  • Created over 7 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Takes your webpack config and creates a development server with hot module reloading and error overlay

Webpack Serve

Takes your webpack config and creates a development server with hot module reloading and error overlay. Built to resemble the experience you get from create-react-app.

Install

npm install --save-dev @unfold/webpack-serve

Usage

In the terminal

Either run $(npm bin)/webpack-serve at the root of your project, or add a "serve": "webpack-serve", to your package.json scripts. All arguments given are passed over to the webpack CLI.

With own express/connect backend

You can import and configure it with your own middleware or server.

import webpackServe from '@unfold/webpack-serve'
import config from '../webpack.config'
import server from './server'

webpackServe(config, {
  server,
  port: 5050,
})

Options

name description default value
port Port used for server 8080
hostname Used by webpack and when opening the application in the browser on start localhost
contentBase Which folder to serve static content from /public
https Serves content with SSL false

Pass them to webpackServe(config, { ...options }) or use PORT=5000 HTTPS=true webpack-serve in the terminal.

Quick example

mkdir my-app && cd my-app
echo "alert('πŸ€“')" > index.js
mkdir public && echo "<script src=build.js></script>" > public/index.html
npm install @unfold/webpack-serve
$(npm bin)/webpack-serve index.js build.js

Copy the above code and run it in your terminal and you'll have a new app up and running. When you want to add webpack loaders or similar, use the webpack CLI options or add a webpack.config.js file.

Example screenshots from console and error overlay

screenshot showing compiled successfully screenshot showing warnings screenshot showing error screenshot showing error overlay

Credits

This project is using multiple utilities from react-dev-utils and the console look is shamelessly copied from the create-react-app console.

More Repositories

1

react-firebase

React bindings for Firebase
JavaScript
106
star
2

heroku-buildpack-pnpm

Run PNPM install on Heroku
Shell
37
star
3

spriter

CSS sprite sheet generator
JavaScript
16
star
4

dev-server

Webpack development server
JavaScript
12
star
5

browserify-hogan

Browserify transform plugin for Hogan.js templates
JavaScript
8
star
6

grunt-git-revision

JavaScript
5
star
7

whack-a-mole

Demo for React + Firebase
JavaScript
4
star
8

reactive

React client/server example
JavaScript
4
star
9

react-in-the-responsive-world

Responsive images in React
JavaScript
3
star
10

browserify-ejs

Browserify transform plugin for EJS templates
JavaScript
3
star
11

norwegian-utils

Some functions to handle Norwegian phone numbers etc.
TypeScript
3
star
12

jquery.taplizer

JavaScript
2
star
13

The-Chase

Simple websocket experiment with iPhone controllers
JavaScript
2
star
14

CacheSize

"Caching" images locally for better performance on animating scaled images.
JavaScript
2
star
15

istanbul-instrument-loader

Istanbul Instrument Loader for Webpack
JavaScript
2
star
16

gulpfile-install

[Unmaintained] Gulpfile-install is a command line application that scans your gulpfile.js and install all dependencies.
JavaScript
2
star
17

react-redux-firebase

React bindings for Firebase with Redux
JavaScript
1
star
18

flummox-todo

A minimalist flummox todo list example.
JavaScript
1
star
19

legacy

Legacy browser style sheet generator
JavaScript
1
star
20

Howl

Flash audio bridge
ActionScript
1
star
21

behind

Behind
JavaScript
1
star
22

slide-layout-engine

Simple slide layout manager
JavaScript
1
star
23

retina

CSS processor which adds retina declarations where retina version images are found, generates scaled down non-retina images and updates the existing stylesheet
JavaScript
1
star
24

denon-firebase

Firebase + Denon Amplifier
JavaScript
1
star
25

vae_local

Vae Platform Local Development Environment
Ruby
1
star
26

Husky

JavaScript
1
star
27

transit

Declarative state and physics based transitions in React
JavaScript
1
star
28

jQuery-Transition

Hardware accelerated jQuery transitions
JavaScript
1
star
29

jquery.tapClick

This plugin should solve your unresponsive slow taps.
JavaScript
1
star
30

livewatch

Watches for filesystem changes, runs build systems, and sends updates to LiveReload compatible clients
JavaScript
1
star
31

react-firebase-full-circle

JavaScript
1
star