Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

static-webpack-plugin

mushishi7824ISC0.2.1

A static-site generator powered by webpack.

readme

Static Webpack Plugin

Very simple static-site generator powered by webpack.

Install

$ npm install --save-dev static-webpack-plugin

Usage

webpack.config.js

var StaticWebpackPlugin = require('static-webpack-plugin');

module.exports = {
  entry: {
    'client': './client.js',
    'static': './static.js'
  },
  output: {
    path: './public',
    filename: '[name].js',
    libraryTarget: 'umd' /* IMPORTANT - must be requirable */
  },
  plugins: [new StaticWebpackPlugin('static.js')]
};

static.js

module.exports = function(render, done) {
  render('index.html', '<html>Index</html>');
  render('about/index.html', '<html>About</html>');
  done();
};