Skip to content

How to get full JS/CSS source to inline (e.g. Mailer templates or PDF generation) #201

Answered by ElMassimo
zealot128 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Stefan! @zealot128

Regarding the styles for mailers, using premailer-rails might also be a good option.


I assume inlining JS is only relevant for the third use case:

generating charts offline by the server, e.g. D3/Highcharts by running a chrome instance and making screenshots

Could you elaborate on why is it desirable to inline the JS?


The following error suggests that you are combining separate ESM files into a single one:

Uncaught SyntaxError: duplicate export name 'A'

Combining modules into a single file is not a trivial task and requires full analysis, a task that is perfect for Rollup (Vite). Alternatively, you could use one of these hacks to inline each file separately.

I'…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@zealot128
Comment options

@ElMassimo
Comment options

@zealot128
Comment options

@ElMassimo
Comment options

Answer selected by ElMassimo
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
3 participants