question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Purge only specific file

See original GitHub issue

Hey,

I tried to find any issue, or something in wiki but no luck there. I will try to describe my problem best I can.

Given I have files app.less

admin.less

File admin.less contains styles for admin theme, so I do not want to purge admin.less. I will provide path to templates, where purgeCss can scan for classes, and I want to purge only app.less, totally ignoring admin.less. Is it somehow possible?

Regards.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

10reactions
r1chm8commented, Aug 21, 2019

I actually managed to solve this issue using the original purgecss package, instead of Spatie’s package.

const mix = require('laravel-mix');
const purgecss = require('@fullhuman/postcss-purgecss');

mix.sass('resources/sass/front.scss', 'front/css')
mix.sass(
    'resources/sass/back.scss',
    'back/css',
    {},
    [ purgecss({ ... }) ]
);
8reactions
r1chm8commented, Aug 21, 2019

Yeah, I made that possible by doing the following:

let options = [];

if (mix.inProduction()) {
    options.push(
        purgecss({ ... })
    );

    mix.version();
}

// ...

mix.sass(
    'resources/sass/back.scss',
    'back/css',
    {},
    options,
);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing: Single File Cache Purge - The Cloudflare Blog
We're excited today to announce single file purge. The feature allows you to purge the cache of any URL without affecting any other...
Read more >
How to delete only specific file type from a folder in ... - YouTube
... how to delete only specific file type from a folder in Windows Computer.https://www.facebook.com/trickshungerTelegram: http://t.me/fr...
Read more >
How to batch-delete folders with only one file in it? - Super User
Open up PowerShell ISE and try running this: $targets = @() $folders = dir "D:\Users\Forza\Music\" | Where {$_.mode -match "d"} foreach ...
Read more >
Delete all files of specific type (extension) recursively down a ...
In this answer, you delete everything that matches the file name in the entire drive. So if you wanted to delete some dll...
Read more >
Robocopy - Exclude specific file from purge within subdirectory
I want to exclude a specific file from being deleted while still performing a purge. The specific file is located within a subdirectory...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found