> For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /api/rspeedy/rspeedy.dev.writetodisk.md.

# 

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](/api/rspeedy/index.md) > [@lynx-js/rspeedy](/api/rspeedy/rspeedy.md) > [Dev](/api/rspeedy/rspeedy.dev.md) > [writeToDisk](/api/rspeedy/rspeedy.dev.writetodisk.md)

## Dev.writeToDisk property

Used to control whether the build artifacts of the development environment are written to the disk.

**Signature:**

```typescript
writeToDisk?: boolean | ((filename: string) => boolean) | undefined;
```

## Default Value

true

## Remarks

This is bypassed to [\`webpack-dev-middleware\`](https://github.com/webpack/webpack-dev-middleware?tab=readme-ov-file#writetodisk)<!-- -->.

Setting `writeToDisk: true` won't change the behavior of the `webpack-dev-middleware`<!-- -->, and bundle files accessed through the browser will still be served from memory.

This option also accepts a `Function` value, which can be used to filter which files are written to disk.

The function follows the same premise as `Array#filter` in which a return value of `false` will not write the file, and a return value of `true` will write the file to disk.

## Example

```js
// lynx.config.ts
import { defineConfig } from '@lynx-js/rspeedy'
export default defineConfig({
  dev: {
    writeToDisk: (filePath) => /superman\.css$/.test(filePath),
  },
})
```
