mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
docs: fix some pages (#24632)
This commit is contained in:
@@ -34,7 +34,7 @@ By default, Bun's CSS bundler targets the following browsers:
|
||||
|
||||
The CSS Nesting specification allows you to write more concise and intuitive stylesheets by nesting selectors inside one another. Instead of repeating parent selectors across your CSS file, you can write child styles directly within their parent blocks.
|
||||
|
||||
```css title="styles.css" icon="file-code"
|
||||
```scss title="styles.css" icon="file-code"
|
||||
/* With nesting */
|
||||
.card {
|
||||
background: white;
|
||||
@@ -100,7 +100,7 @@ This compiles to:
|
||||
|
||||
The `color-mix()` function gives you an easy way to blend two colors together according to a specified ratio in a chosen color space. This powerful feature lets you create color variations without manually calculating the resulting values.
|
||||
|
||||
```css title="styles.css" icon="file-code"
|
||||
```scss title="styles.css" icon="file-code"
|
||||
.button {
|
||||
/* Mix blue and red in the RGB color space with a 30/70 proportion */
|
||||
background-color: color-mix(in srgb, blue 30%, red);
|
||||
|
||||
@@ -231,23 +231,67 @@ const myPlugin: BunPlugin = {
|
||||
### onResolve
|
||||
|
||||
<Tabs>
|
||||
<Tab title="options">- 🟢 `filter` - 🟢 `namespace`</Tab>
|
||||
<Tab title="options">
|
||||
|
||||
- 🟢 `filter`
|
||||
- 🟢 `namespace`
|
||||
|
||||
</Tab>
|
||||
<Tab title="arguments">
|
||||
- 🟢 `path` - 🟢 `importer` - 🔴 `namespace` - 🔴 `resolveDir` - 🔴 `kind` - 🔴 `pluginData`
|
||||
|
||||
- 🟢 `path`
|
||||
- 🟢 `importer`
|
||||
- 🔴 `namespace`
|
||||
- 🔴 `resolveDir`
|
||||
- 🔴 `kind`
|
||||
- 🔴 `pluginData`
|
||||
|
||||
</Tab>
|
||||
<Tab title="results">
|
||||
- 🟢 `namespace` - 🟢 `path` - 🔴 `errors` - 🔴 `external` - 🔴 `pluginData` - 🔴 `pluginName` - 🔴 `sideEffects` -
|
||||
🔴 `suffix` - 🔴 `warnings` - 🔴 `watchDirs` - 🔴 `watchFiles`
|
||||
|
||||
- 🟢 `namespace`
|
||||
- 🟢 `path`
|
||||
- 🔴 `errors`
|
||||
- 🔴 `external`
|
||||
- 🔴 `pluginData`
|
||||
- 🔴 `pluginName`
|
||||
- 🔴 `sideEffects`
|
||||
- 🔴 `suffix`
|
||||
- 🔴 `warnings`
|
||||
- 🔴 `watchDirs`
|
||||
- 🔴 `watchFiles`
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### onLoad
|
||||
|
||||
<Tabs>
|
||||
<Tab title="options">- 🟢 `filter` - 🟢 `namespace`</Tab>
|
||||
<Tab title="arguments">- 🟢 `path` - 🔴 `namespace` - 🔴 `suffix` - 🔴 `pluginData`</Tab>
|
||||
<Tab title="options">
|
||||
|
||||
- 🟢 `filter`
|
||||
- 🟢 `namespace`
|
||||
|
||||
</Tab>
|
||||
<Tab title="arguments">
|
||||
|
||||
- 🟢 `path`
|
||||
- 🔴 `namespace`
|
||||
- 🔴 `suffix`
|
||||
- 🔴 `pluginData`
|
||||
|
||||
</Tab>
|
||||
<Tab title="results">
|
||||
- 🟢 `contents` - 🟢 `loader` - 🔴 `errors` - 🔴 `pluginData` - 🔴 `pluginName` - 🔴 `resolveDir` - 🔴 `warnings` -
|
||||
🔴 `watchDirs` - 🔴 `watchFiles`
|
||||
|
||||
- 🟢 `contents`
|
||||
- 🟢 `loader`
|
||||
- 🔴 `errors`
|
||||
- 🔴 `pluginData`
|
||||
- 🔴 `pluginName`
|
||||
- 🔴 `resolveDir`
|
||||
- 🔴 `warnings`
|
||||
- 🔴 `watchDirs`
|
||||
- 🔴 `watchFiles`
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -134,8 +134,6 @@ CMD ["bun", "index.ts"]
|
||||
|
||||
This image installs dependencies and runs your app with Bun inside a container. If your app doesn't have dependencies, you can omit the `RUN bun install --production --frozen-lockfile` line.
|
||||
|
||||
This image installs dependencies and runs your app with Bun inside a container. If your app doesn't have dependencies, you can omit the `RUN bun install --production --frozen-lockfile` line.
|
||||
|
||||
</Note>
|
||||
|
||||
Create a new `.dockerignore` file in the root of your project. This file contains the files and directories that should be _excluded_ from the container image, such as `node_modules`. This makes your builds faster and smaller:
|
||||
@@ -159,8 +157,7 @@ Make sure you're in the directory containing your `Dockerfile`, then deploy dire
|
||||
|
||||
<Note>
|
||||
Update the `--region` flag to your preferred region. You can also omit this flag to get an interactive prompt to
|
||||
select a region. Update the `--region` flag to your preferred region. You can also omit this flag to get an
|
||||
interactive prompt to select a region.
|
||||
select a region.
|
||||
</Note>
|
||||
|
||||
```bash terminal icon="terminal"
|
||||
|
||||
@@ -64,10 +64,10 @@ Later, when this test file is executed again, Bun will read the snapshot file an
|
||||
|
||||
```sh terminal icon="terminal"
|
||||
bun test
|
||||
bun test v1.3.2 (9c68abdb)
|
||||
```
|
||||
|
||||
```txt
|
||||
bun test v1.3.2 (9c68abdb)
|
||||
test/snap.test.ts:
|
||||
✓ snapshot [1.05ms]
|
||||
|
||||
@@ -83,10 +83,10 @@ To update snapshots, use the `--update-snapshots` flag.
|
||||
|
||||
```sh terminal icon="terminal"
|
||||
bun test --update-snapshots
|
||||
bun test v1.3.2 (9c68abdb)
|
||||
```
|
||||
|
||||
```txt
|
||||
bun test v1.3.2 (9c68abdb)
|
||||
test/snap.test.ts:
|
||||
✓ snapshot [0.86ms]
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ scripts[test:watch] # bracket for special chars
|
||||
Examples:
|
||||
|
||||
```bash terminal icon="terminal"
|
||||
# set
|
||||
# get
|
||||
bun pm pkg get name # single property
|
||||
bun pm pkg get name version # multiple properties
|
||||
bun pm pkg get # entire package.json
|
||||
|
||||
@@ -7,8 +7,7 @@ Bun supports [`workspaces`](https://docs.npmjs.com/cli/v9/using-npm/workspaces?v
|
||||
|
||||
It's common for a monorepo to have the following structure:
|
||||
|
||||
```
|
||||
tree
|
||||
```txt File Tree icon="folder-tree"
|
||||
<root>
|
||||
├── README.md
|
||||
├── bun.lock
|
||||
|
||||
@@ -401,6 +401,7 @@ Environment variable: `BUN_INSTALL_BIN`
|
||||
|
||||
```toml title="bunfig.toml" icon="settings"
|
||||
# where globally-installed package bins are linked
|
||||
[install]
|
||||
globalBinDir = "~/.bun/bin"
|
||||
```
|
||||
|
||||
|
||||
@@ -697,7 +697,7 @@ To list some or all (up to 1,000) objects in a bucket, you can use the `S3Client
|
||||
```ts s3.ts icon="/icons/typescript.svg" highlight={12, 15-20, 24-29}
|
||||
import { S3Client } from "bun";
|
||||
|
||||
const credentials = { ... }
|
||||
const credentials = {
|
||||
accessKeyId: "your-access-key",
|
||||
secretAccessKey: "your-secret-key",
|
||||
bucket: "my-bucket",
|
||||
|
||||
Reference in New Issue
Block a user