Complete the code to enable purging unused styles in Tailwind CSS configuration.
module.exports = {
content: [[1]],
theme: {
extend: {},
},
plugins: [],
}The content array tells Tailwind where to look for class names to keep. Using "./src/**/*.{html,js}" includes all HTML and JS files in the src folder, which is typical.
Complete the code to add a safelist to prevent purging of specific classes.
module.exports = {
content: ["./src/**/*.{html,js}"],
safelist: [[1]],
theme: {
extend: {},
},
plugins: [],
}The safelist expects an array of strings. Each string is a class name to keep. Here, "bg-red-500" is a single class name in the array.
Fix the error in the purge configuration to correctly specify the content paths.
module.exports = {
purge: [[1]],
theme: {
extend: {},
},
plugins: [],
}purge key without proper file extensions.jsx.In Tailwind v3+, the purge key is replaced by content. But if using purge, it should include all file types where classes appear, like jsx for React files.
Fill both blanks to configure Tailwind to purge unused styles from HTML and Vue files.
module.exports = {
content: [[1], [2]],
theme: {
extend: {},
},
plugins: [],
}The content array should include paths to all files that use Tailwind classes. Here, HTML and Vue files are included.
Fill all three blanks to configure Tailwind with content paths, safelist, and enable JIT mode.
module.exports = {
mode: [1],
content: [[2]],
safelist: [[3]],
theme: {
extend: {},
},
plugins: [],
}Setting mode to "jit" enables Just-In-Time compilation. The content array points to source files. The safelist includes classes like "aos-animate" that should never be purged.