mirror of
https://github.com/goauthentik/authentik
synced 2026-04-30 11:27:15 +02:00
WIP; WIP 2 web: Flesh out fixtures, test IDs. web: Flesh out provider tests. web: Flesh out LDAP test. web: Fix typo. web: Allow base URL to be updated. web: Clean up. web: Tidy types. web: Update ARIA attributes for better test targeting. web: Clean up message labeling. web: Clean up ARIA labels. web: Flesh out table ARIA labels. web: Flesh out series. web: Fix linter. web: Clean up test reporting, timing issues. Add RADIUS test.
30 lines
690 B
JavaScript
30 lines
690 B
JavaScript
/**
|
|
* @file Vite plugin to inline CSS imports
|
|
* @import { Plugin as VitePlugin } from "vite";
|
|
*/
|
|
|
|
const CSSImportPattern = /import [\w$]+ from .+\.(css)/g;
|
|
const JavaScriptFilePattern = /\.m?(js|ts|tsx)$/;
|
|
|
|
export function inlineCSSPlugin() {
|
|
/**
|
|
* @satisfies {VitePlugin}
|
|
*/
|
|
const inlineCSSPlugin = {
|
|
name: "inline-css-plugin",
|
|
transform: (source, id) => {
|
|
if (!JavaScriptFilePattern.test(id)) return;
|
|
|
|
const code = source.replace(CSSImportPattern, (match) => {
|
|
return `${match}?inline`;
|
|
});
|
|
|
|
return {
|
|
code,
|
|
};
|
|
},
|
|
};
|
|
|
|
return inlineCSSPlugin;
|
|
}
|