Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Webpack blocks - Webpack Dev Server

JavaScript Style Guide NPM Version

This is the dev-server block providing webpack dev server configuration.

Usage

const { createConfig, env } = require('@webpack-blocks/webpack')
const devServer = require('@webpack-blocks/dev-server')

module.exports = createConfig([
  // use only if `NODE_ENV === 'development'`:
  env('development', [
    devServer(),
    // if you need to proxy API requests:
    devServer.proxy({
      '/api': { target: 'http://localhost:3000' }
    }),
    // in case you are using react-hot-loader 2.x:
    // (need to install `react-hot-loader` package manually, though)
    devServer.reactHot()
  ])
])

Pitfalls

Make sure you use this dev-server block after your entryPoint() blocks. The dev server will extend all of them with the 'webpack/hot/only-dev-server' entry point by default.

If you sense that this might be a major problem for you, feel free to engage in the pre/post-processing discussion.

Webpack blocks

Check out the

👉 Main Documentation

Released under the terms of the MIT license.