1.2.0 • Published 9 years ago

metalsmith-plugin-webpack v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

metalsmith-webpack

Build Status Dependency Status devDependency Status

js-standard-style

A webpack plugin for Metalsmith.

install

npm install elliottsj/metalsmith-webpack

usage

var webpack = require('metalsmith-webpack')

Metalsmith(__dirname)
  .use(webpack(config))
  .build()

config

config can be either:

  1. A webpack configuration object (see the webpack configuration documentation for details.)
  2. A function that takes metalsmith arguments (files, metalsmith) and returns a webpack configuration object, e.g.

    Metalsmith(__dirname)
      .use(webpack(function(files, metalsmith) {
        return {...}
      }))
      .build()

example

Metalsmith(__dirname)
  .use(webpack({
    entry: './src/index.js',
    output: {
      path: path.resolve(__dirname, './build/'),
      filename: 'bundle.js'
    }
  }))
  .build()

See the tests for more examples.

tests

$ npm test

license

MIT License, see LICENSE for details.