
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
postcss-purgecss-laravel
Advanced tools
postcss-purgecss wrapper with sensible defaults for Laravel apps
postcss-purgecss
wrapper with sensible defaults for Laravel appsA simple wrapper around postcss-purgecss
with sensible defaults for Laravel apps.
// postcss.config.js
module.exports = {
plugins: [
require('postcss-purgecss-laravel')({
whitelistPatterns: [/hljs/],
extend: {
content: [content: [path.join(__dirname, 'vendor/spatie/menu/**/*.php')],]
},
});
],
};
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
You can install the package with yarn or npm:
yarn add postcss-purgecss-laravel --dev
npm install postcss-purgecss-laravel --save-dev
Register the PostCSS plugin.
// postcss.config.js
module.exports = {
plugins: [
require('postcss-purgecss-laravel')(/* ... */);
]
}
All options passed to the plugin get passed down to PurgeCSS. Refer to the PurgeCSS docs for an overview of the available options.
// postcss.config.js
module.exports = {
plugins: [
require('postcss-purgecss-laravel')({
whitelistPatterns: [/hljs/],
}),
],
};
Options will override the default options this package provides. If you'd rather extend the options, place them in the extend
option.
// postcss.config.js
module.exports = {
plugins: [
require('postcss-purgecss-laravel')({
extend: {
whitelistPatterns: [/hljs/],
},
}),
],
};
In the above example, the /hljs/
pattern will be added to the whitelistPatterns
, instead of overriding the default whitelistPatterns
option.
These are the defaults this package provides:
const defaultConfig = {
content: [
"app/**/*.php",
"resources/**/*.html",
"resources/**/*.js",
"resources/**/*.jsx",
"resources/**/*.ts",
"resources/**/*.tsx",
"resources/**/*.php",
"resources/**/*.vue",
"resources/**/*.twig",
],
defaultExtractor: (content) => content.match(/[\w-/.:]+(?<!:)/g) || [],
whitelistPatterns: [/-active$/, /-enter$/, /-leave-to$/, /show$/],
};
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
2.0.0
FAQs
postcss-purgecss wrapper with sensible defaults for Laravel apps
The npm package postcss-purgecss-laravel receives a total of 6,503 weekly downloads. As such, postcss-purgecss-laravel popularity was classified as popular.
We found that postcss-purgecss-laravel demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.