PurgeCSSPurgeCSS
API Reference
GitHub
API Reference
GitHub
  • PurgeCSS

    • About PurgeCSS
    • Getting Started
    • Configuration
    • Command Line Interface
    • Programmatic API
    • Safelisting
    • Extractors
  • Plugins

    • PostCSS
    • Webpack
    • Gulp
    • Grunt
    • Gatsby
  • Guides

    • Vue
    • React
    • Next.js
    • Nuxt.js
    • Razzle
    • WordPress
    • Hugo
  • Comparison
  • Common Questions

    • How to use with CSS modules
    • How to use with Ant Design

Home > @fullhuman/purgecss-from-tsx > purgeFromTsx

purgeFromTsx() function

Create function to extract selectors from tsx code

Signature:

declare function purgeFromTsx(options?: {
    acornOptions?: acorn.Options;
    tsOptions?: ts.CompilerOptions;
}): (content: string) => string[];

Parameters

Parameter

Type

Description

options

{ acornOptions?: acorn.Options; tsOptions?: ts.CompilerOptions; }

(Optional) acorn options

**Returns:**

(content: string) => string[]

the function to extract selectors from tsx code

Edit this page