klap vs microbundle?
For me, personally
- cleaner and more organized codebase
- zero deps
- different set of default babel and rollup plugins
- microbundle supports Buble
Let's add comparison section in readme. I'll keep this open in case someone gets there before me.
@tunnckoCore it seems microbundle moved away from buble. Am I missing something?
I did a quick comparison between klap, microbundle and tsdx. Here are notable differences:
:angel: Comparison with microbundle and tsdx
| Feature | klap | microbundle | tsdx |
|---|---|---|---|
| Typescript Support | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| No Dependencies | :white_check_mark: | :x: | :x: |
| Scaffolding | :white_check_mark: | :x: | :white_check_mark: |
| Dev Server | :white_check_mark: | :x: | :x: |
| CSS | :x: | :white_check_mark: | :white_check_mark: |
| CSS Modules | :x: | :white_check_mark: | :x: |
| Build Constants | :x: | :white_check_mark: | :white_check_mark: |
| Testing/Linting | :x: | :x: | :white_check_mark: |
We should probably start supporting build constants and some variation of CSS (maybe using postcss).
The testing/linting setup is not a primary goal for klap and we can skip it.
Yup, true, they kind of moved to a hybrid approach as I remember.
Agree.
Build Constants
What do you mean with that? TSDX supports transforming such things, I think. :)
Build constants are essentially constant variables that are pre-defined. Similar to process.env.NODE_ENV, but more granular.
For example, you can define a constant called DEBUG = true and use DEBUG in your library code when developing, maybe like this:
if(DEBUG){
console.log('this was never supposed to happen')
}
Then you just run the build for distribution with DEBUG = false and all your code within the if block get's removed.
Another use case is when you want to create multiple versions of your library with certain features on/off based on a defined build constant.
Exactly. TSDX does this. Dev expressions, node_env and etc, also uses the replace plugin, so.. probably possible to customize further.