Rollup and Buble were awesome, no reason to maintain a project which has similar purpose but no more feature.
Simple javascript bundler integrated webpack and babel.
Webel is useful for a small project or testing some features. Webel also has watch mode to build application immediately for developing.
$ npm install --save-dev webel
The compiled result is written into memory-fs and has been piped to stdout in default, you can pipe the result into a file simply.
In normal mode
, result will be piped to `stdout` but won't in watch mode
, you can use option --output
to export the result into a file. If you use --watch
without --output
, the result will just stored in memory, its works like a dynamic syntax corrector.
// Build an application
$ webel entry.js > bundle.js
// Watch an application
$ webel --watch entry.js -o bundle.js
// package.json
...
"scripts": {
"build": "webel index.js -o dist/app.js",
"watch": "webel index.js -wo dist/app.js"
},
...
Usage | Description | Alias |
---|---|---|
--watch |
Start in watch mode | -w |
--output file |
Pipe result to the specified file | -o |
--minimize |
Minimize the result | -m |
--source-map |
Generate source map file, works only if -o has provided |
-s |
You can also provide a configuration file to webel for more customizable, just create an file named webel.config.js
under your project directory.
Remember, configuration file only works if it is --dev
installation.
babel.plugins
and babel.presets
will extends the default values.
externals
allows Array and also Boolean value. (default: true) (externals === true ? nodeExternals() : [])
// webel.config.js defaults
module.exports = {
babel: {
plugins: [
'transform-async-to-generator',
'transform-runtime'
],
presets: [
['es2015', { modules: false }],
'stage-2'
]
},
externals: [
require('webpack-node-externals')()
],
plugins: []
}
-
webpack.NoErrorsPlugin
: When there are errors while compiling, skips the emitting phase. -
progress-bar-webpack-plugin
: For more friendly compiling messages.