File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,10 @@ module.exports = {
55
55
title : 'Rollup' ,
56
56
path : '/guide/rollup' ,
57
57
} ,
58
+ {
59
+ title : 'esbuild' ,
60
+ path : '/guide/esbuild' ,
61
+ } ,
58
62
{
59
63
title : 'Electron' ,
60
64
path : '/guide/electron' ,
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : esbuild Bundler Plugin
3
+ ---
4
+
5
+ ::: tip Before Reading
6
+ Head on over to the [ Introduction] ( ../intro/ ) or [ Quick Start] ( ../intro/quick-start ) if you haven't already.
7
+ :::
8
+
9
+ The esbuild plugin is a separate package, which you'll need to install:
10
+
11
+ ``` sh
12
+ yarn add -D @app-config/esbuild@2
13
+ ```
14
+
15
+ Then add it to your esbuild configuration:
16
+
17
+ ``` javascript
18
+ const { createPlugin: appConfig } = require (' @app-config/esbuild' );
19
+
20
+ require (' esbuild' )
21
+ .build ({
22
+ bundle: true ,
23
+ entryPoints: [' ./src/index.ts' ],
24
+ outfile: ' ./dist/index.js' ,
25
+ // this is the line we care about
26
+ plugins: [appConfig ()],
27
+ })
28
+ .catch (() => process .exit (1 ));
29
+ ```
30
+
31
+ This will allow you to import ` @app-config/main ` from your application, with all
32
+ filesystem and other Node.js code stripped out (when using ` bundle ` ).
33
+
34
+ ``` javascript
35
+ import config from ' @app-config/main' ;
36
+ ```
You can’t perform that action at this time.
0 commit comments