Cannot import large JavaScript module with staticDir #248
Answered
by
Ethosa
lorenzncode
asked this question in
Q&A
-
I set staticDir as: staticDir "/static" -> "src/public" ~ "html,js,css" The problem is the browser fails to load my large bundle.js. <script type="module" async>
import('/static/js/bundle.js').then(({ default: DefaultExport, myfunction}) => {
myfunction();
});
</script> This works: staticDir "/static" -> "src/public" ~ "html,css"
get "/static/js/bundle.js":
let path = "./src/public/js/bundle.js"
await req.answerFile(path, forceResponse = true) Is there a change I need to make in my code so that staticDir or |
Beta Was this translation helpful? Give feedback.
Answered by
Ethosa
Apr 8, 2024
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lorenzncode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
staticDir
usesforceResponse = false
at now, so you should useanswerFile
withforceResponse = true