webpack-blocks
v2.1.0
Published
Convenience package that includes all the most common webpack blocks.
Downloads
1,343
Readme
webpack-blocks - the convenience package
This is the webpack-blocks convenience package. It wraps all the most commonly used blocks, so you can install just this single package and have webpack-blocks and your favorite blocks set up.
Usage
Here is a small sample configuration. Instead of requiring from @webpack-blocks/webpack
,
@webpack-blocks/babel
and others you just need a single require()
and a single dependency in
your package.json
.
Of course you can still separately define or install custom blocks and use them as you want.
const webpack = require('webpack')
const {
babel,
createConfig,
css,
defineConstants,
entryPoint,
env,
extractText,
match,
setOutput,
uglify,
postcss
} = require('webpack-blocks')
const cssnano = require('cssnano')
module.exports = createConfig([
entryPoint('./src/main.js'),
setOutput('./build/bundle.js'),
babel(),
defineConstants({
'process.env.NODE_ENV': process.env.NODE_ENV
}),
match('*.css', { exclude: /node_modules/ }, [
css(),
env('production', [
extractText(),
postcss({
plugins: [cssnano()]
})
])
]),
env('production', [uglify()])
])
Included blocks
webpack-blocks
Check out the
Released under the terms of the MIT license.