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

[Bug]: Purgecss not purging bootstrap.js #1115

Open
raccoonwannafly opened this issue May 15, 2023 · 0 comments
Open

[Bug]: Purgecss not purging bootstrap.js #1115

raccoonwannafly opened this issue May 15, 2023 · 0 comments
Labels

Comments

@raccoonwannafly
Copy link

raccoonwannafly commented May 15, 2023

Purgecss not purging bootstrap .js

I'm using customized bootstrap while using gulp-purgecss plugin to purge excess css
However it seems like it doesn't look into the javascript files, for example in my html the class .show is not included, it's actually from Bootstrap's javascript file, so purgecss in my case isn't watching for .js files
If someone could look into my gulpfile setting to verify I'd_be appreciated
My gulpfile.js:

const sass = require('gulp-sass')(require('sass'))
const purgecss = require('gulp-purgecss')

function buildStyles() {
    return src('sass/**/*.scss')
    .pipe(sass())
    .pipe(purgecss({ content: ['*.html', '../dist/*.js'] }))
    .pipe(dest('dist')) 
}

function watchTask() {
    watch(['sass/**/*.scss', '*.html'], buildStyles) 
    watch(['sass/**/*.scss', './dist/*.js'], buildStyles) 
}

exports.default = series(buildStyles, watchTask);
@Ffloriel Ffloriel changed the title [Bug]: [Bug]: Purgecss not purging bootstrap.js Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant