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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add section information about skip codegen plugin #2553

Closed
wants to merge 2 commits into from
Closed
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
23 changes: 23 additions & 0 deletions website/pages/docs/guides/component-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,29 @@ export default defineConfig({
})
```

### Skip codegen in the consuming app

Since we intend to use `@acme-org/styled-system` in the consuming app, it's not necessary to generate a local `styled-system`. One way to achieve this is to create a plugin, which we can add to our `panda.config.ts`:

```tsx filename="panda.config.ts
import { defineConfig, definePlugin } from '@pandacss/dev';

const skipCodegenPlugin = definePlugin({
name: 'skip-codegen',
hooks: {
'codegen:prepare': () => {
return [];
},
},
});

export default defineConfig({
plugins: [skipCodegenPlugin],
// ...
```

This way, we avoid bundling `outdir` twice and it's clearer to developers which should be used.

## FAQ

### Why should my component library use an external package `styled-system`?
Expand Down