Skip to content

Commit 3b464d5

Browse files
committed
feat(nano-build): microservice preset
1 parent 2691697 commit 3b464d5

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

packages/nano-build/README.md

+13
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@ Add the following scripts to your `package.json`:
106106
}
107107
```
108108

109+
### `--preset=microservice`
110+
111+
```js
112+
{
113+
...defaultPreset,
114+
format: 'esm',
115+
treeShaking: true,
116+
outfile: 'dist/main.mjs',
117+
mangleProps: '_$',
118+
target: 'node20'
119+
}
120+
```
121+
109122
## Configuration
110123

111124
Add 'nano-build' field to your `package.json` for overwriting configuration:

packages/nano-build/nano-build.cjs

+7
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ const defaultOptions = {
4343

4444
const presetRecord = {
4545
default: defaultOptions,
46+
microservice: {
47+
format: 'esm',
48+
treeShaking: true,
49+
outfile: 'dist/main.mjs',
50+
mangleProps: '_$',
51+
target: 'node20'
52+
},
4653
module: {
4754
format: 'esm',
4855
cjs: true,

0 commit comments

Comments
 (0)