erbelion / vite-plugin-laravel-purgecss

A Vite plugin that integrates PurgeCSS with Laravel template assets. Apart from Blade, it also supports frontend frameworks such as Svelte, Vue, React and Angular. It works well with Inertia.
MIT License
26 stars 4 forks source link

Hash of css file not changing after adding Bootstrap class to blade view #6

Open Drifterdnl opened 1 year ago

Drifterdnl commented 1 year ago

When I add the pb-3 Bootstrap css class on a <div> element the hash of the css file and in my manifest.json doesn't change after running npm run build.

Using version: @erbelion/vite-plugin-laravel-purgecss: 0.2.2 laravel-vite-plugin: 0.7.8 vite: 3.2.7

vite.config.js:

import { defineConfig } from 'vite'
import laravel from 'laravel-vite-plugin'
import purge from '@erbelion/vite-plugin-laravel-purgecss'

export default defineConfig({
    plugins: [
        laravel({
            input: ['resources/sass/app.scss', 'resources/js/app.js'],
            refresh: true,
        }),
        purge({
            templates: ['blade'],
            paths: ['resources/js/**/*.js'],
            safelist: [/show/, /icon-/, /offcanvas-backdrop/, /overflow/],
        }),
    ],
})
erbelion commented 1 year ago

thanks for letting know, i'll look into it soon

erbelion commented 1 month ago

i've looked into this problem several times, and i can't figure it out. in rollup, asset hashes are generated before generateBundle hook, which is used here to purge css assets.

pr's welcome