You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: app/docs/md/patterns/browser-modules.md
+17-1
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,23 @@
1
1
---
2
-
title: Browser Modules
2
+
title: Building for the browser
3
3
---
4
4
5
+
## The `@bundles` plugin
6
+
7
+
For most of your browser needs you can use Enhance's built-in [browser pattern](/docs/conventions/browser) but at times you may have a component that has special imports like `css-in-js` that requires the abilities of ESBuild. In these situations you can use [plugin-bundles](https://github.com/architect/plugin-bundles) to make your component available to the browser.
8
+
9
+
### Install
10
+
11
+
`npm i npm i @architect/plugin-bundles`
12
+
13
+
Add to your `.arc file`
14
+
15
+
```arc
16
+
@bundles
17
+
autocomplete '/utils/autocomplete.mjs'
18
+
```
19
+
20
+
5
21
### Basic Example
6
22
7
23
If you have written a bit of JS for your app that has an external dependency, you'll likely want to bundle your script with its dependency.
0 commit comments