/** * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. * For licensing, see LICENSE.md. */ import type { Plugin } from "vite"; /** * Preserves the source execution order of CSS imports in manual development and production builds. * * Vite extracts imported CSS into assets and orders those assets by the generated chunk graph. * In a multi-page build that order may differ from the source module execution order, changing * the cascade between CKEditor stylesheets. This is a known Vite limitation: * https://github.com/vitejs/vite/issues/4890. * * Until Vite handles this natively (https://github.com/vitejs/vite/pull/22541), plain CSS imports * in production builds are replaced with virtual JavaScript modules. Each module loads the * processed CSS through Vite's `?inline` query and appends it as a `