-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use esbuild for bundling instead rollup
- Loading branch information
Showing
14 changed files
with
301 additions
and
780 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()] | ||
}); | ||
}) |
Oops, something went wrong.