vite script tag gets added to json
insanity54 opened this issue · comments
Describe the bug
I have a src/api/v1.njk file as follows
---
layout: false
permalink: '/api/v1.json'
---
{
"taco": "yes, please"
}
The problem I'm seeing is that <script type="module" src="/@vite/client"></script>
gets added to the top of the file when serving. v1.json is served with content-type: text/html
when I need it to be served as application/json
To Reproduce
I made a git repo to illustrate
https://github.com/insanity54/slinkity-issue
npm run serve
(npx @11ty/eleventy --config=eleventy.config.js --serve) and click the /api/v1.json link. The json is served as text/html
with a script tag at the top.
Expected behavior
I expected /api/v1.json to be a application/json
file when viewing /api/v1.json
in a web browser