-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(nano-build): Add nano-build usage and configuration instructions
- Loading branch information
Showing
2 changed files
with
71 additions
and
1 deletion.
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,3 +1,73 @@ | ||
# Nano build | ||
|
||
Build/bundle tools for ECMAScript, TypeScript, and JavaScript libraries. It's easy to use, doesn't require any setup, and adheres to best practices. It has no dependencies and uses esbuild for enhanced performance. | ||
|
||
## Usage | ||
|
||
Install the package: | ||
|
||
```bash | ||
yarn add -D @alwatr/nano-build | ||
``` | ||
|
||
Add the following scripts to your `package.json`: | ||
|
||
```json | ||
{ | ||
"scripts": { | ||
"build": "nano-build", | ||
"watch": "nano-build --watch", | ||
"clean": "rm -rfv dist .tsbuildinfo" | ||
}, | ||
} | ||
``` | ||
|
||
## Configuration | ||
|
||
Add 'nano-build' field to your `package.json`: | ||
|
||
```json | ||
{ | ||
"nano-build": { | ||
"bundle": true | ||
}, | ||
"nano-build-development": { | ||
"minify": false, | ||
"sourcemap": true | ||
}, | ||
"nano-build-production": { | ||
"minify": true, | ||
"sourcemap": false | ||
} | ||
} | ||
``` | ||
|
||
default configuration: | ||
|
||
```json | ||
{ | ||
"entryPoints": ["src/main.ts"], | ||
"outdir": "dist", | ||
"logLevel": "info", | ||
"platform": "node", | ||
"target": "es2020", | ||
"format": "esm", | ||
"cjs": true, | ||
"minify": true, | ||
"mangleProps": "_$", | ||
"treeShaking": false, | ||
"sourcemap": true, | ||
"sourcesContent": true, | ||
"bundle": true, | ||
"packages": "external", | ||
"splitting": false, | ||
"charset": "utf8", | ||
"legalComments": "none", | ||
"banner": { | ||
"js": "/* @package_name v@package_version */" | ||
}, | ||
"define": { | ||
"__package_version": "'@package_version'" | ||
} | ||
} | ||
``` |
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