Skip to content

Commit 223f019

Browse files
docs(astro-angular): add docs on filtering file transforms with Astro (#1580)
1 parent b378f0d commit 223f019

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/astro-angular/README.md

+21
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,27 @@ export default defineConfig({
132132
});
133133
```
134134

135+
### Filtering File Transforms
136+
137+
For better compatibility when integrating with other plugins such as [Starlight](https://starlight.astro.build), put the Angular components in a specific folder and use the `transformFilter` callback function to only transform those files.
138+
139+
```js
140+
import { defineConfig } from 'astro/config';
141+
import angular from '@analogjs/astro-angular';
142+
143+
export default defineConfig({
144+
integrations: [
145+
angular({
146+
vite: {
147+
transformFilter: (_code, id) => {
148+
return id.includes('src/components'); // <- only transform Angular TypeScript files
149+
},
150+
},
151+
}),
152+
],
153+
});
154+
```
155+
135156
### Transforming Packages for SSR Compatibility
136157

137158
To ensure Angular libraries are transformed during Astro's SSR process, add them to the `ssr.noExternal` array in the Vite config.

0 commit comments

Comments
 (0)