Skip to content

How to handle files using imports in a javascript file being minified with type="module" #1141

Answered by carltongibson
sanderese asked this question in Q&A
Discussion options

You must be logged in to vote

Generally you want to set COMPRESS_PRECOMPILERS to point to your preferred JS pipeline.

e.g. I have this in one project...

COMPRESS_PRECOMPILERS = (
    ("text/x-tailwind", POSTCSS_TAILWIND_COMMAND),
    ("text/x-elm", ELM_MAKE_COMMAND),
)

Where POSTCSS_TAILWIND_COMMAND and ELM_MAKE_COMMAND just pass-off to postcss a elm make respectively. You can substitute web pack or parcel or esbuild or ... as you need.

I hope that helps.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@sanderese
Comment options

@rjbullock
Comment options

@Richdark
Comment options

Answer selected by sanderese
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants