Skip to content

Commit

Permalink
feat(nano-build): add weaver configs(--preset=weaver)
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammadhonarvar committed Oct 2, 2024
1 parent 295eeec commit 1bae458
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
27 changes: 25 additions & 2 deletions packages/nano-build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ Add the following scripts to your `package.json`:
}
```

### `--preset=pmpa`
### `--preset=weaver`

```js
{
...defaultPreset,
entryPoints: ['site/_ts/*.ts'],
entryPoints: ['src/ts/*.ts'],
outdir: 'dist/es',
platform: 'browser',
format: 'iife',
Expand Down Expand Up @@ -119,6 +119,29 @@ Add the following scripts to your `package.json`:
}
```

### `--preset=pmpa`

```js
{
...defaultPreset,
entryPoints: ['site/_ts/*.ts'],
outdir: 'dist/es',
platform: 'browser',
format: 'iife',
mangleProps: '_$',
treeShaking: true,
sourcemap: false,
sourcesContent: false,
target: [
'es2018',
'chrome62',
'edge79',
'firefox78',
'safari11',
],
}
```

## Configuration

Add 'nano-build' field to your `package.json` for overwriting configuration:
Expand Down
11 changes: 11 additions & 0 deletions packages/nano-build/nano-build.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ const presetRecord = {
sourcesContent: false,
target: ['es2018', 'chrome62', 'edge79', 'firefox78', 'safari11'],
},
weaver: {
entryPoints: ['src/ts/*.ts'],
outdir: 'dist/es',
platform: 'browser',
format: 'iife',
mangleProps: '_$',
treeShaking: true,
sourcemap: false,
sourcesContent: false,
target: ['es2018', 'chrome62', 'edge79', 'firefox78', 'safari11'],
},
microservice: {
platform: 'node',
format: 'esm',
Expand Down

0 comments on commit 1bae458

Please sign in to comment.