I want to serve a js file, but have it parse velocity.
I have a template that is very short:
$response.addHeader(“Content-Type”, “text/javascript”)
$response.setContentType(“text/javascript”)
//Javascript file
#parseContainer(‘8382a988a9ad2cde7f1732ac1c20d4d1’,‘1746023283648’)
The container just puts out text. Chrome keeps telling me:
‘Refused to execute script from ‘https://revvable-prod.dotcms.cloud/revvabe-text.js’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled.’
Yes, I am using htmlpageasset to ‘build’ the page. My understanding is that if I serve the file as file asset, it won’t parse Velocity. I know there’s some funky parts to outputting the header and response, so that’s why I am doing it first, in the template top.
Any hints, or perhaps a ‘that won’t work’? I’ve done it in the past with .svg files.