I unsuccessfully tried to remove unused css imported from an external css file.
I have tried a lot of combinaisons in vain, every time I run the build script I end up with a huge bundle.css.
Here is the list of everything I tried so far:
- Importing the file from App.svelte
<script>
- Importing the file from App.svelte
<style>
(using postcss-import) - Importing the file directly from main.js
- Using postcss-purgecss along with rollup-plugin-postcss instead of passing by svelte-preprocess
I am pretty sure there is something I am doing wrong but I honestly cannot figure out what.
If anyone have a clue on how to resolve this I would love to hear some feedback.
Simple repo example: https://github.com/mgrisole/svelte-playground
You need to follow these steps:
rollup-plugin-postcss
inrollup.config.js
:rollup.config.js
) with:postcss.config.js
: