After integrating laravel-mix-purgecss into my Laravel project, everything seemed to be going smoothly until I realized that it was removing all the CSS from Summernote. How can I prevent Purgecss from stripping out Summernote's CSS classes or ensure that all necessary classes are included for Summernote to function properly?
It's worth noting that Summernote was working fine before implementing Purgecss. Additionally, Summernote is located within a Vue Component.
Here are the steps I've taken so far:
webpack.mix.js
let mix = require('laravel-mix');
const glob = require('glob-all');
require('laravel-mix-purgecss');
mix.js('resources/assets/js/app.js', 'public/js')
.js('resources/assets/js/app-admin.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css')
.sass('resources/assets/sass/app-admin.scss', 'public/css')
.purgeCss({
enabled: true,
// The following code did not resolve the issue and causes an error when running 'npm run dev'
// globs: () => [
// path.join(__dirname, 'node_modules/summernote/**/*.js'),
// ],
// This code was found to be unnecessary as it works without it
// paths: () => glob.sync([
// path.join(__dirname, 'resources/views/**/*.blade.php'),
// path.join(__dirname, 'resources/assets/js/**/*.vue')
// ]),
extensions: ['html', 'js', 'php', 'vue']
});
Summernote is being used in a .vue component
<script>
import 'summernote'
export default {
components: {
'summernote' : require('./../Summernote')
},
.....
}
</script>