Skip to content

Commit

Permalink
fix: use default work folder and build folder for watch ignore (#358)
Browse files Browse the repository at this point in the history
* use defaults for watch ignore

* fix up readme

* fix typo
  • Loading branch information
samchungy authored Aug 15, 2022
1 parent 845c7a8 commit 0135695
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ See [example folder](examples) for some example configurations.
| `installExtraArgs` | Optional arguments passed to npm or yarn for `external` dependency resolution. eg. `['--legacy-peer-deps']` for npm v7+ to use legacy `peerDependency` resolution behavior | `[]` |
| `keepOutputDirectory` | Keeps the `.esbuild` output folder. Useful for debugging. | `false` |
| `nativeZip` | Uses the system's `zip` executable to create archives. _NOTE_: This will produce non-deterministic archives which causes a Serverless deployment update on every deploy. | `false` |
| `outputBuildFolder` | The output folder for Esbuild builds within the work folder. | `'.build'` |
| `outputWorkFolder` | The output folder for this plugin where all the bundle preparation is done. | `'.esbuild'` |
| `outputBuildFolder` | The output folder for Esbuild builds within the work folder. You will also need to manually override the watch ignore config if used. | `'.build'` |
| `outputWorkFolder` | The output folder for this plugin where all the bundle preparation is done. You will also need to manually override the watch ignore config if used. | `'.esbuild'` |
| `outputFileExtension` | The file extension used for the bundled output file. This will override the esbuild `outExtension` option | `'.js'` |
| `packagePath` | Path to the `package.json` file for `external` dependency resolution. | `'./package.json'` |
| `packager` | Packager to use for `external` dependency resolution. Values: `npm`, `yarn`, `pnpm` | `'npm'` |
Expand Down Expand Up @@ -114,7 +114,7 @@ The following `esbuild` options are automatically set.
| Option | Description | Default |
| --------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `pattern` | An [anymatch-compatible definition](https://github.com/es128/anymatch) for the watcher to respond to | `./\*_/_.(js\|ts)` (watches all `.js` and `.ts` files) |
| `ignore` | An [anymatch-compatible definition](https://github.com/es128/anymatch) for the watcher to ignore | `[{outputBuildFolder}, 'dist', 'node_modules', {outputWorkFolder}]` |
| `ignore` | An [anymatch-compatible definition](https://github.com/es128/anymatch) for the watcher to ignore | `'.esbuild', 'dist', 'node_modules', '.build']` |

## Supported Runtimes

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class EsbuildServerlessPlugin implements ServerlessPlugin {
installExtraArgs: [],
watch: {
pattern: './**/*.(js|ts)',
ignore: [this.outputWorkFolder, 'dist', 'node_modules', this.outputBuildFolder],
ignore: [WORK_FOLDER, 'dist', 'node_modules', BUILD_FOLDER],
},
keepOutputDirectory: false,
packagerOptions: {},
Expand Down

0 comments on commit 0135695

Please sign in to comment.