Expand description
oj’s stylesheet pipeline: lightningcss for CSS (modules, lowering, url
rebasing), grass for Sass, and postcss-import style @import inlining,
each resolving specifiers the way Vite does.
Structs§
- CssModules
Options - Vite’s
css.modules(postcss-modules) options oj applies. - CssOutput
- CssResolve
- How specifiers inside a stylesheet resolve beyond plain relative paths, as
Vite’s CSS resolvers do:
resolve.aliasapplies to@import,@useandurl(), and a root-absolute/src/xresolves against the root, with the public directory taking precedence. - CssResolve
Config - Owned
CssResolvefor holders that outlive a borrow. - Sass
Options - How a Sass stylesheet is compiled: the importer’s directory, configured
loadPaths, thenode_modulesabove it,additionalData, and alias / root-absolute resolution.
Functions§
- browser_
targets - esbuild-style targets as lightningcss browsers, like Vite’s
convertTargets: the lowest version per browser wins, non-browser names (es2020,node18) are skipped, and no browser at all means the baseline. - compile_
css - compile_
css_ dev - The dev-server compile: urls rebased to server-absolute ones, aliased ones to the url of the file they name, as Vite’s url rewriter does.
- compile_
css_ rebased - compile_
css_ rebased_ with_ map compile_css_rebasedplus an inline source map back tourl.- compile_
css_ with - The build compile:
build.cssMinifyandbuild.cssTargetfromresolve. - compile_
sass - compile_
sass_ collecting compile_sass_opts, appending every stylesheet loaded todeps(sass’sincludedFiles, Vite’s HMR dependencies for the sheet).- compile_
sass_ opts - compile_
sass_ with - css_
modules_ esm - The JS module for a class map, shaped like Vite’s
dataToEsm(map, { namedExports: true }): the map is the default export and every legal identifier is also a named export. - inline_
imports - Inline plain
@imports so the stylesheet carries the imported rules. Relative imports resolve against the importer, bare ones throughnode_modules(style/mainentry).layer(...),supports(...)and external imports stay as written; inlined files’ urls are rebased tofile’s directory. - inline_
imports_ collecting inline_imports_with, appending every inlined file todeps(Vite’s HMR dependencies for the sheet).- inline_
imports_ with inline_importswith aliases and root-absolute specifiers.- is_
css_ module - is_sass
- node_
modules_ load_ paths - Every
node_modulesdirectory fromdirup to the filesystem root, nearest first. - resolve_
css_ import - postcss-import’s order: relative to the importer, then a node_modules
package (its
style/mainentry, or a file inside it);~accepted. - resolve_
css_ import_ with resolve_css_importafter Vite’s alias and root-absolute steps. A path alias resolves there, a package alias continues as a bare specifier;/xis the public file, else a file under the root, else a real absolute path.