Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PurifyCss in Production results in broken Css #1579

Closed
3Descape opened this issue Apr 3, 2018 · 4 comments
Closed

PurifyCss in Production results in broken Css #1579

3Descape opened this issue Apr 3, 2018 · 4 comments

Comments

@3Descape
Copy link

3Descape commented Apr 3, 2018

Npm: 5.8.0
Node: 8.4.0
Laravel Mix: 1.7.2 and 2.1.0 Tested

Using purifyCss with npm run prod results in not working Css, as a lot styles are missing, even though listed under whitelist: [] and used in blade files.

webpack.mix.js:

mix.js('resources/assets/js/app.js', 'public/js')
    .js('resources/assets/js/admin.js', 'public/js')
    .sass('resources/assets/sass/app.scss', 'public/css')
    .sass('resources/assets/sass/admin.scss', 'public/css')
    .copy('node_modules/cropperjs/dist/cropper.min.css', 'public/css')
    .options({
        purifyCss: {
            purifyOptions: {
                purifyCss: true,
                whitelist: ['collapsing', 'callapse', 'show', 'collapsed', 'fa', '*fa*', 'blockquote']
            },
        }
    });

Repository: https://github.com/3Descape/EV.git You should rename .env.example to .env and have a DB called ev.

@ankurk91
Copy link
Contributor

ankurk91 commented Apr 7, 2018

You might want to use
https://github.com/spatie/laravel-mix-purgecss

@3Descape
Copy link
Author

3Descape commented Apr 7, 2018

works like a charm! thank you very much

@rivajunior
Copy link
Contributor

I am with the same problem. This wasn't fix yet?

@alex7r
Copy link

alex7r commented Nov 26, 2018

Yeah, if somebody is interested in this:

I've faced the same issue and was able to fix it, please fill free to use it as
npm install git://github.com/alex7r/purifycss.git#master
while it's waiting to be accepted.

After digging deep I've found that the cause was not the code in this repo, but the code in the dependency of the 2nd level:
purifycss => rework => css
So please look at the PR to find out more info
reworkcss/css#118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants