0

In an Astro app, I am consuming an (in-house) React component library where the components import their own styling which is expressed in files such as Foo.css.map (for the Foo component).

As I am using api routes, I have files such as pages/samples/[id].astro.

But when the library components render within [id].astro and perform their own imports, the [id].astro file additionally renders with id having values like Foo.css.map. I only want [id].astro to be invoked when the requested url ends with Foo, not Foo.css.map.

How can I exclude certain file patterns from turning into API routes?

Perhaps something to do with how I name the pages/samples/[id].astro file?

Jonathan.Brink
  • 23,757
  • 20
  • 73
  • 115
  • Can you share a [link to a reproduction of the problem](https://stackblitz.com/edit/astro-u5svtq?file=src%2Fpages%2Fsamples%2F[id].astro&on=stackblitz)? – tony19 Aug 28 '22 at 05:11
  • What's the problem exactly? Are you trying to optimize network requests, or do you need to obfuscate your source code on the client? – Nick McCurdy Sep 04 '22 at 12:56

0 Answers0