dn-middleware-webpack-hmr
v1.1.1
Published
webpack HMR middleware for dawn template
Downloads
13
Readme
dn-middleware-webpack-hmr
Webpack HMR middleware for dawn template. (Compatible with wepback 3.x)
Warning: support React only.
Features
- Enable hot module reload (HMR)
Create-react-app
development experience (usereact-dev-utils
)
Getting Started
- update your .dawn/pipe.yml:
dev:
- name: webpack-hmr
- Mark your root component as hot-exported: (detail see react-hot-loader)
// App.js
import React from 'react'
import { hot } from 'react-hot-loader'
const App = () => <div>Hello World!</div>
export default hot(module)(App)
- update dependencies
$ dn update
$ dn dev
Options
Example
dev:
- name: webpack-hmr
port: 7777 // set dev-server listening port (default a random port)
eslint: false // disable eslint check, default `true`
inject: // inject to webpack entries
- babel-polyfill
template: ./assets/*.html // html-webpack-plugin template
sourceMap: true // enable sourceMap, default `true`
common: // common dependencies chunk building
disabled: true