Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates docs to have users install the bundles plugin before using. #195

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
---
title: Browser Modules
title: Building for the browser
---

## The `@bundles` plugin

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.

### Install

`npm i npm i @architect/plugin-bundles`
kristoferjoseph marked this conversation as resolved.
Show resolved Hide resolved

Add to your `.arc file`

```arc
@bundles
kristoferjoseph marked this conversation as resolved.
Show resolved Hide resolved
autocomplete '/utils/autocomplete.mjs'
```


### Basic Example

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.
Expand Down
4 changes: 2 additions & 2 deletions app/docs/nav-data.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const data = [
slug: 'patterns',
items: [
'progressive-enhancement',
'browser-modules',
'building-for-the-browser',
'form-validation',
{
slug: 'testing',
Expand Down Expand Up @@ -262,6 +262,6 @@ function parseItems(items, root, activePath) {
return parsedItems
}

export default function (docsRoute, activePath) {
export default function(docsRoute, activePath) {
return parseItems(data, docsRoute, activePath)
}
Loading