webpkr

Webpkr is a build system for webpack configurations.

Declarative Build Scripts

  • Write declarative build scripts.

  • Stop mutating monolithic objects.

  • Plain ol' JavaScript.

 // base.js
context( projectDir )
entry( './src/index.js')
output( () => {
  filename( 'bundle.js' )
  path$( 'dist' ) } )

Single Build Truth

  • All code in the same build script.

  • No need to clone configurations.

 // devtool.js
 // only for NODE_ENV=development
development( () => {
  devtool( 'cheap-module-source-map' ) } )

Logical Partitioning

  • Partition code logically for reuse.

 // css.js
plugin( new ExtractTextPlugin( ) )
module$( () => {
  rule( () => {
    test( /\.css$/ )
    use( ExtractTextPlugin.extract( {
      use: 'css-loader', } ) ) } ) } )

Just require

  • Order of assembly is largely unimportant.

  • Webpkr builds correct configuration object.

 //index.js
require('./base')
require('./devtool')
require('./css')  //that's it