Skip to content

Commit ede00f3

Browse files
committed
docs: esbuild readme
1 parent 5f7ba32 commit ede00f3

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

app-config-esbuild/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## App Config esbuild
2+
3+
Use app-config with esbuild.
4+
5+
Install:
6+
7+
```sh
8+
yarn add -D @app-config/esbuild
9+
```
10+
11+
Then add it to your esbuild configuration:
12+
13+
```javascript
14+
const { createPlugin: appConfig } = require('@app-config/esbuild');
15+
16+
require('esbuild')
17+
.build({
18+
bundle: true,
19+
entryPoints: ['./src/index.ts'],
20+
outfile: './dist/index.js',
21+
// this is the line we care about
22+
plugins: [appConfig()],
23+
})
24+
.catch(() => process.exit(1));
25+
```
26+
27+
This will allow you to import `@app-config/main` from your application, with all
28+
filesystem and other Node.js code stripped out (when using `bundle`).

0 commit comments

Comments
 (0)