discourse/app/assets/javascripts/theme-transpiler/url-polyfill.js
David Taylor 834ea70b1c
DEV: Improve postcss error handling (#31420)
Followup to 087e8e4bdb

- Fixes the variable-prefixer so it doesn't explode when the input is
unparseable
- Add URL polyfills so that postcss can print its errors properly
- Catch postcss errors in the same way as sass errors
2025-02-20 16:48:22 +00:00

7 lines
158 B
JavaScript

export function pathToFileURL(path) {
return new URL(path, "file://").toString();
}
export function fileURLToPath(url) {
return new URL(url).pathname;
}