Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JS support for PostCSS config #27819

Open
@nivekcode

Description

Command

config

Description

Currently the CLI supports custom PostCSS configurations in the format of JSON files. The problem is that the JSON format has its limitation. In our case for example we try to configure CSS purging with the fullhuman/postcss-purgecss plugin.

{
 "plugins": {
 "@fullhuman/postcss-purgecss": {
 "content": ["**/*.html", "**/*.ts", "**/*.js"],
 "skippedContentGlobs": ["node_modules/**"],
 }
 }
}

Unfortunately this config is not enough and therefore we would need to configure some extractors:

import purgeJs from "purgecss-from-js";
import purgeHtml from "purgecss-from-html";
const options = {
 content: [], // files to extract the selectors from
 css: [], // css
 extractors: [
 {
 extractor: purgeJs,
 extensions: ["js"],
 },
 {
 extractor: purgeHtml,
 extensions: ["html"],
 },
 ],
};
export default options;

Describe the solution you'd like

Support PostCSS configuration files writen in JavaScript.

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /