| | |
| | | import { FilePath, FullSlug, joinSegments } from "../../util/path" |
| | | import { FullSlug, joinSegments } from "../../util/path" |
| | | import { QuartzEmitterPlugin } from "../types" |
| | | |
| | | // @ts-ignore |
| | |
| | | import { Features, transform } from "lightningcss" |
| | | import { transform as transpile } from "esbuild" |
| | | import { write } from "./helpers" |
| | | import DepGraph from "../../depgraph" |
| | | |
| | | type ComponentResources = { |
| | | css: string[] |
| | |
| | | export const ComponentResources: QuartzEmitterPlugin = () => { |
| | | return { |
| | | name: "ComponentResources", |
| | | async getDependencyGraph(_ctx, _content, _resources) { |
| | | return new DepGraph<FilePath>() |
| | | }, |
| | | async *emit(ctx, _content, _resources) { |
| | | const cfg = ctx.cfg.configuration |
| | | // component specific scripts and styles |
| | |
| | | }, |
| | | include: Features.MediaQueries, |
| | | }).code.toString(), |
| | | }), |
| | | yield write({ |
| | | ctx, |
| | | slug: "prescript" as FullSlug, |
| | | ext: ".js", |
| | | content: prescript, |
| | | }), |
| | | yield write({ |
| | | ctx, |
| | | slug: "postscript" as FullSlug, |
| | | ext: ".js", |
| | | content: postscript, |
| | | }) |
| | | }) |
| | | |
| | | yield write({ |
| | | ctx, |
| | | slug: "prescript" as FullSlug, |
| | | ext: ".js", |
| | | content: prescript, |
| | | }) |
| | | |
| | | yield write({ |
| | | ctx, |
| | | slug: "postscript" as FullSlug, |
| | | ext: ".js", |
| | | content: postscript, |
| | | }) |
| | | }, |
| | | async *partialEmit() {}, |
| | | } |
| | | } |