metalsmith-plugin-webpack
v1.2.0
Published
A webpack plugin for Metalsmith
Downloads
31
Maintainers
Readme
metalsmith-webpack
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:
A webpack configuration object (see the webpack configuration documentation for details.)
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.