Great solution! One thing that i'm still struggling with, i can't seem to use regular classes in my svelte files like <div class="bg-red-200">...</div>. It works if i rerun sapper dev. If i use @apply inside tag it works fine. Btw i added inside _layout.svelte. Any idea how to get this working without having to rerun npm run dev every time?
Thanks for the information! In fact, using process.env.NODE_ENV in both setups would be better. However since process.env.ROLLUP_WATCH is used to determine mode in rollup.config.js, I wanted to be consistent with it. I've changed it to process.env.NODE_ENV in Sapper template.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great solution! One thing that i'm still struggling with, i can't seem to use regular classes in my svelte files like inside _layout.svelte. Any idea how to get this working without having to rerun npm run dev every time?
<div class="bg-red-200">...</div>
. It works if i rerun sapper dev. If i use @apply inside tag it works fine. Btw i addedI'm not sure why it is happening. I will check this issue when I create the sapper template.
I faced the same problem but fixed it with the following change.
Change line12 in postcss.config.js
from : const production = !process.env.ROLLUP_WATCH
to : const production = process.env.NODE_ENV !=='development'
Thanks for the information! In fact, using
process.env.NODE_ENV
in both setups would be better. However sinceprocess.env.ROLLUP_WATCH
is used to determine mode inrollup.config.js
, I wanted to be consistent with it. I've changed it toprocess.env.NODE_ENV
in Sapper template.