Socket
Socket
Sign inDemoInstall

@webpack-blocks/dev-server

Package Overview
Dependencies
485
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @webpack-blocks/dev-server

Webpack block for the webpack dev server.


Version published
Maintainers
2
Install size
30.6 MB
Created

Readme

Source

webpack-blocks - Webpack Dev Server

Gitter chat 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({
      // Show full-screen overlay in the browser on compiler errors or warnings
      overlay: true,

      // If you need to proxy API requests:
      proxy: {
        '/api': { target: 'http://localhost:3000' }
      }
    })
  ])
])

Don’t forget to enable hot reload in your app. If you’re using React it may look like this:

import React from 'react'
import ReactDOM from 'react-dom'

function render() {
  ReactDOM.render(<h1>Hello, webpack-blocks!</h1>, document.getElementById('root'))
}

render()

if (module.hot) {
  module.hot.accept(render)
}

webpack-blocks

Check out the

👉 Main documentation

Released under the terms of the MIT license.

Keywords

FAQs

Last updated on 27 Apr 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc