Skip to content

Commit

Permalink
use esbuild for bundling instead rollup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxNB committed Dec 30, 2020
1 parent fd41f4a commit 8f73983
Show file tree
Hide file tree
Showing 14 changed files with 301 additions and 780 deletions.
10 changes: 5 additions & 5 deletions COMPARE.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# How much tinro adds to your bandle?

Current tinro value is **4.48 Kb** (1.78 Kb gzipped)
Current tinro value is **1.66 Kb** (0.59 Kb gzipped)

## Comparsion

* bundle.js with tinro inside: **20.32 Kb** (6.53 Kb gzipped)
* bundle.js with mocked tinro : **15.84 Kb** (4.75 Kb gzipped)
* bundle.js with tinro inside: **24.68 Kb** (7.92 Kb gzipped)
* bundle.js with mocked tinro : **23.02 Kb** (7.32 Kb gzipped)

## How do we compare?

Comparsion made by building [testing app](https://github.com/AlexxNB/tinro/tree/master/tests) two times. First one with tinro letest version inside. In the second case - all imports from tinro are mocked by empty exports.
Comparsion made by building [testing app](https://github.com/AlexxNB/tinro/tree/master/tests) in production mode two times. First one with tinro letest version inside. In the second case - all imports from tinro are mocked by empty exports.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![npm](https://img.shields.io/npm/v/tinro?style=flat-square) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/AlexxNB/tinro/Publish%20on%20NPM?label=test&style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/tinro?label=Bundle%20size&style=flat-square) ![npm](https://img.shields.io/npm/dt/tinro?style=flat-square)


The tinro is highly declarative, very tiny ([~4.5 Kb (1.9 Kb gzipped)](https://github.com/AlexxNB/tinro/blob/master/COMPARE.md)), dependency free router for [Svelte's](https://svelte.dev) web applications.
The tinro is highly declarative, very tiny ([~1.7 Kb (0.6 Kb gzipped)](https://github.com/AlexxNB/tinro/blob/master/COMPARE.md)), dependency free router for [Svelte's](https://svelte.dev) web applications.

## Features

Expand Down
40 changes: 40 additions & 0 deletions esbuild.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const esbuild = require('esbuild');
const sveltePlugin = require('esbuild-svelte');
const pkg = require('./package.json');

(async ()=>{
await esbuild.build({
entryPoints: ['src/tinro.js'],
bundle: true,
outfile: 'dist/tinro_lib.js',
format: 'esm',
external: [
'svelte',
'svelte/*'
]
});

await esbuild.build({
entryPoints: ['src/tinro.js'],
bundle: true,
outfile: pkg.module,
format: 'esm',
external: [
'svelte',
'svelte/*'
],
plugins: [sveltePlugin()]
});

await esbuild.build({
entryPoints: ['src/tinro.js'],
bundle: true,
outfile: pkg.main,
format: 'cjs',
external: [
'svelte',
'svelte/*'
],
plugins: [sveltePlugin()]
});
})
Loading

0 comments on commit 8f73983

Please sign in to comment.