rollup-plugin-postcss
rollup-plugin-postcss copied to clipboard
fix: order multiple inputs correctly
See the issue here: https://github.com/egoist/rollup-plugin-postcss/issues/461.
Summary of the problem
When using multiple inputs in rollup, css output from any non-first inputs that do not exist in the first input are placed at the top of the output and are ordered by resolve order, causing css output for multiple inputs to be non-deterministic.
Summary of the fix
In order to fix this problem, we need to trace all the places in which we are importing css and sort based on all those sources. I needed to expand some of the functions to allow for multiple entry paths, but was able to keep the seen
checking to prevent multiple checks of shared files.
Tests were added to demonstrate that the fix works.