-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
Description
Describe the problem:
I'm having an issue where changes don't get detected when I'm making changes to the plugin function part of some plugin in my tailwind config.
I've tracked it down to the point where using plugin.withOptions seems to be the problem.
Is there a way to make Tailwind/webpack detect changes made to the plugin function when using plugin.withOptions?
Link to a minimal reproduction:
When using plugin.withOptions, only changes made to the config function get detected:
//tailwind.config.js
const plugin = require('tailwindcss/plugin')
module.exports = {
plugins: [
plugin.withOptions(
function() {
return function(pluginApi) {
const {addBase} = pluginApi
addBase({
'body': {
backgroundColor: 'green' // Changes made here are not detected
},
})
}
},
function() {
return {
theme: {
colors: {
blue: {
'500': 'blue', // Changes made here are detected
},
}
}
}
}
)
],
}
When using plugin without options, changes made to the plugin and config function get detected:
//tailwind.config.js
const plugin = require('tailwindcss/plugin')
module.exports = {
plugins: [
plugin(
function(pluginApi) {
const {addBase} = pluginApi
addBase({
'body': {
backgroundColor: 'green' // Changes made here are detected
},
})
},
function() {
return {
theme: {
colors: {
blue: {
'500': 'blue', // Changes made here are detected
},
}
}
}
}
)
],
}