Simple and easy to use solution for building your modules to native ES syntax.
You can found this project on Deno.land registry.
Run the following command:
deno install \
--allow-read \
--allow-write \
--allow-env \
--allow-run \
--name esbuilder \
https://deno.land/x/esbuilder/builder.ts
- Clone this repository
- Open repo in VS Code
- Open Command Pallete (
Ctrl + Shift + P
/β + Shift + P
)- Select β
Tasks: Run Task
- Run β
Install ESBuilder
- Select β
- Clone this repository
- Run the following command:
deno install \
--allow-read \
--allow-write \
--allow-env \
--allow-run \
--allow-net \
--no-prompt \
--name esbuilder \
./builder.ts
Simple!
deno uninstall esbuilder
esbuilder --config=./config.json
esbuilder --help
deno run --allow-all ./builder.ts --config=./config.json
deno run --allow-all ./builder.bundled.js --config=./config.json
{
"version": "1.0",
"sourceDir": "./src",
"outDir": "./dist",
"files": [
"./file1.ts",
"./file2.ts",
],
"build": {
"bundle": true,
"minify": true,
"sourcemap": true
},
"options": {
"watch": true,
"gitignore": true,
}
}
Version of config schema/syntax. Defaults to current version of Builder.
{
"version": "1.0"
}
The notation "1.0"
and "1.0.0"
are equivalent.
Path to source directory.
Defaults to ./
.
{
"sourceDir": "./src"
}
Path to output directory.
Defaults to ./build
.
{
"outDir": "./dist"
}
Paths to entry files relative to sourceDir
.
{
"files": [
"./file1.ts",
"./dir/file2.ts",
]
}
{
"files": {
"MyGroupA": "./file1.ts",
"MyGroupB": [
"./file1.ts",
"./dir/file2.ts"
]
}
}
Whether to bundle entry file (with dependecies) into a single file.
Defaults to false
.
{
"build": {
"bundle": true
}
}
Whether to minify the output.
Defaults to false
.
{
"build": {
"minify": true
}
}
Whether to create source map files.
Defaults to false
.
{
"build": {
"sourcemap": true
}
}
Whether to print verbose output.
Defaults to true
.
{
"options": {
"verbose": false
}
}
If true
, watch for changes in source files and rebuild.
Defaults to false
.
You can forced by passing --watch
flag.
{
"options": {
"watch": true
}
}
Path to tsconfig.json.
Defaults to null
.
{
"options": {
"tsconfig": "./tsconfig.json"
}
}
Whether to create .gitignore
with built outputs.
Defaults to false
.
{
"options": {
"gitignore": true
}
}
Whether to create json file with description of all built outputs.
Defaults to false
.
{
"options": {
"outputSummary": true
}
}
Example I of output summary:
{
"version": "1.0",
"files": [
"./file1.js",
"./file1.js.map",
"./dir/file2.js",
"./dir/file2.js.map"
]
}
Example II of output summary:
{
"version": "1.0",
"files": {
"MyGroupA": [
"./file1.js",
"./file1.js.map"
],
"MyGroupB": [
"./file1.js",
"./file1.js.map",
"./dir/file2.js",
"./dir/file2.js.map"
]
}
}
Name of the output summary file.
Defaults to output-summary.json
.
{
"options": {
"outputSummaryFilename": "output-summary.json"
}
}