1.4.2 • Published 10 months ago

postcss-import-rewrite v1.4.2

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
10 months ago

postcss-import-rewrite

A simple import statement rewriter that was to be developed so Blazor css isolation @import statements wont cause problems when using postcss and tailwindcss. It probably has other uses.

Configuration Options

Example:

{
    envvars: [
        'DOTNET_PROJECT_DIR',
        'DOTNET_CONFIG_NAME',
        'DOTNET_TARGET_FRAMEWORK',
    ],
    rewrites: [
        {
            template: "'{0}\\{3}\\obj\\{1}\\{2}\\scopedcss\\projectbundle\\{4}",
            match: /^'_content\/([\w.]*)\/([\w.]*bundle\.scp\.css'?)$/g,
            disablePathFix: false
        },
        {
            template: "'{0}\\{3}\\obj\\{1}\\{2}\\scopedcss\\bundle\\{4}",
            match: /^'_content\/([\w.]*)\/([\w.]*styles\.css'?)$/g,
            disablePathFix: false
        }
    ],
    deep: false
}
NameDescription
envvarsAn array for environment variables to pull values from.
rewritesAn array of template/match objects.
templateThe replacement template. Use {0} for replacement values, where the number is the index in the envvars array
matchA regex for finding the start of an @import statement. The example looks for the string @import '_content ....
deepIf true, open existing @import files and process their css import statements as well.
disablePathFixIf true, disables path rewrites to match operating system.

Some notes:

  • Any capture groups in the match param will be appended to the envvars list in the order they are matched.
1.4.2

10 months ago

1.4.1

12 months ago

1.4.0

12 months ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago