static-webpack-plugin

0.2.1 • Public • Published

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();
};

/static-webpack-plugin/

    Package Sidebar

    Install

    npm i static-webpack-plugin

    Weekly Downloads

    14

    Version

    0.2.1

    License

    ISC

    Last publish

    Collaborators

    • mushishi78