Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
17 changes: 16 additions & 1 deletion website/docs/en/config/tools/swc.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# tools.swc

- **Type:** `Object | Function`
- **Type:**

```ts
type ToolsSwc =
| Rspack.SwcLoaderOptions
| ((config: Rspack.SwcLoaderOptions) => Rspack.SwcLoaderOptions | undefined);
```

- **Default:**

```js
Expand All @@ -13,7 +20,15 @@ const defaultOptions = {
decorators: true,
},
},
experimental: {
cacheRoot: './node_modules/.cache/.swc',
keepImportAttributes: true,
},
isModule: 'unknown',
env: {
// Read the browserslist configuration of the project
targets: browserslist,
},
// ...some other conditional options
};
```
Expand Down
17 changes: 16 additions & 1 deletion website/docs/zh/config/tools/swc.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# tools.swc

- **类型:** `Object | Function`
- **类型:**

```ts
type ToolsSwc =
| Rspack.SwcLoaderOptions
| ((config: Rspack.SwcLoaderOptions) => Rspack.SwcLoaderOptions | undefined);
```

- **默认值:**

```js
Expand All @@ -13,7 +20,15 @@ const defaultOptions = {
decorators: true,
},
},
experimental: {
cacheRoot: './node_modules/.cache/.swc',
keepImportAttributes: true,
},
isModule: 'unknown',
env: {
// 读取项目的 browserslist 配置
targets: browserslist,
},
// ...some other conditional options
};
```
Expand Down
Loading