webpkr
Webpkr is a build system for webpack
configurations. See docs.
Declarative Build Scripts
- Write declarative build scripts.
- Stop mutating monolithic objects.
- Plain ol' JavaScript.
// base.js
Single Build Truth
- All code in the same build script.
- No need to clone configurations.
// devtool.js // only for NODE_ENV=development
Logical Partitioning
- Partition code logically for reuse.
// css.jsmodule
require
Just - Order of assembly is largely unimportant.
- Webpkr builds correct configuration object.
//index.js //that's it
Getting Started
Install with npm
:
$ npm install -D webpkr webpack
Create src/index.js
and add:
console;
By default, webpkr
looks for config scripts in the ./webpkr
module. Create a webpack
subdirectory in your project's root and add file index.js
in it:
$ mkdir webpkr$ touch webpkr/index.js
Add the following DSL script to webpkr/index.js
:
Create a webpack.config.js
in your project's root and add:
const webpkr = ;moduleexports = ;
Run webpack:
$ ./node_modules/.bin/webpack
The DSL script generates the following webpack configuration:
{ context: '/proj/repos/webpkr/test/simple', entry: './src/index.js', output: { filename: 'bundle.js', path: '/proj/repos/webpkr/test/simple/dist' }}
The bundled output is available in dist/bundle.js
.
See docs.