tailwindcss/src/util/createPlugin.js

22 lines
427 B
JavaScript
Raw Normal View History

function createPlugin(plugin, config) {
return {
handler: plugin,
config,
}
}
2020-10-16 13:30:06 -04:00
createPlugin.withOptions = function (pluginFunction, configFunction = () => ({})) {
const optionsFunction = function (options) {
return {
handler: pluginFunction(options),
config: configFunction(options),
}
}
optionsFunction.__isOptionsFunction = true
return optionsFunction
}
export default createPlugin