spatie / laravel-mix-purgecss

Zero-config Purgecss for Laravel Mix
https://spatie.be/en/opensource
MIT License
874 stars 38 forks source link

import node_module package css in vue will be purge #87

Closed dukechill closed 4 years ago

dukechill commented 4 years ago

I import package css file in vue file

</template>
<script>
import /node_module/xxx.css
export default {
}
</script>
<style>
</style>

and I add purgecss to laravel-mix setting

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css')
    .options({
        processCssUrls: false,
        postCss: [tailwindcss('./tailwind.config.js')],
    }).purgeCss({
        enabled: true,
    });

and this setting will purge the imported css how can i to avoid this situation? use whitelist? or some example i can follow up?

dukechill commented 4 years ago

I found the solution Add class in to whitelistpattern