Fresh plugin for PostCSS integration
// main.ts
import autoprefixer from "https:/esm.sh/autoprefixer@10.4.14";
import { start } from "$fresh/server.ts";
import freshPostcss from "$fresh_postcss/mod.ts";
import manifest from "./fresh.gen.ts";
await start(manifest, {
plugins: [
freshPostcss({
plugins: [
autoprefixer(),
],
}),
],
});
The plugin will search your directory for CSS files, and the CSS will
automatically be injected into <head>
. You can also specify the files using
glob syntax.
// main.ts
await start(manifest, {
plugins: [
freshPostcss({
include: ["static/**/*.css"],
exclude: ["static/_generated/**/*"],
}),
],
});
Currently unable to use
postcss-load-config
. One of
the (indirect) dependencies down the line fails due to an error on
cspotcode/node-source-map-support
.
Related: cspotcode/node-source-map-support#43