Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

metalsmith-webpack-dev-server

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-webpack-dev-server

Starts webpack dev server when running metalsmith

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

metalsmith-webpack-dev-server

A metalsmith plugin to start webpack-dev-server to use in development.

Installation

$ npm install metalsmith-webpack-dev-server

Basic Example

var metalsmith = require('metalsmith');
var webpackDevServer = require('metalsmith-webpack-dev-server');
var webpackConfig = require('./webpack.config.js');

metalsmith(__dirname)
  .use(webpackDevServer(webpackConfig))
  .build(function(err) {
    if (err) { throw err; }
  });

This will start webpack-dev-server on localhost:8081 using default configuration. Pass webpack-dev-server options as a second argument.

Advanced Example

var metalsmith = require('metalsmith');
var webpackDevServer = require('metalsmith-webpack-dev-server');
var webpackConfig = require('./webpack.config.js');

metalsmith(__dirname)
  .use(webpackDevServer(webpackConfig, {
    hot: true, // Enable HMR
    proxy: {
        '*': 'http://localhost:8080'
    },
    // webpack-dev-middleware options
    quiet: true,
    noInfo: true,
    publicPath: 'http://localhost:8081/',
    stats: {colors: true}
  }))
  .build(function(err) {
    if (err) { throw err; }
  });

For more information about webpack-dev-server options see: https://webpack.github.io/docs/webpack-dev-server.html

Options

webpackConfig

Type: Object

Your webpack config. See the [webpack configuration][webpack configuration] documentation for details.

options

Type: Object

webpack-dev-server options. See https://webpack.github.io/docs/webpack-dev-server.html for details.

License

MIT

Keywords

metalsmith

FAQs

Package last updated on 14 Feb 2016

Did you know?

Socket

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