Use import()
syntax for server build in templates
#9876
aaronadamsCA
started this conversation in
Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I think there's a small opportunity to simplify and future-proof some Remix templates by importing the server build using a dynamic import with a
const
assertion.As an example, this:
remix/templates/cloudflare/functions/[[path]].ts
Lines 1 to 8 in cc65962
Could be simplified to this:
The
const
assertion ensures the import isn't evaluated by TypeScript oreslint-plugin-import
. This should mean only one TypeScript ESLint rule needs to be disabled, and future rule changes are less likely to cause new problems.Other templates could potentially benefit from a similar change.
Beta Was this translation helpful? Give feedback.
All reactions