When prettier is executed by user's editors, like VS Code, the calls to process.cwd() can return null. This is usually because the process is being run in a folder that doesn't exist.
This fix extends the getIconCollections function to accept a dir parameter when called, so that you can pass the directory of your tailwind.config.js file in with __dirname. The default value for the parameter for the function should also make it backwards compatible with the old way it was called.
Fixes the issues some users are still having with #3, #9, #16. Note that the users will have to update their tailwind.config.js like so:
const { iconsPlugin, getIconCollections } = require("@egoist/tailwindcss-icons")
module.exports = {
plugins: [
iconsPlugin({
// Select the icon collections you want to use
// collections: getIconCollections(["mdi", "lucide"]), <- old way of configuring plugin
collections: getIconCollections(["mdi", "lucide"], __dirname), // <- new way
}),
],
}
When prettier is executed by user's editors, like VS Code, the calls to
process.cwd()
can return null. This is usually because the process is being run in a folder that doesn't exist.This fix extends the
getIconCollections
function to accept adir
parameter when called, so that you can pass the directory of yourtailwind.config.js
file in with__dirname
. The default value for the parameter for the function should also make it backwards compatible with the old way it was called.Fixes the issues some users are still having with #3, #9, #16. Note that the users will have to update their
tailwind.config.js
like so: