Files
speckle-server/packages/tailwind-theme/utils/tailwind-configure.cjs
T

16 lines
637 B
JavaScript

const { resolve, dirname } = require('path')
/**
* Use this to generate an entry for the Tailwind 'content' config key that will ensure
* this library is scanned to prevent unnecessary purging
* @param {NodeRequire} req Feed in the 'require' object. It needs to be fed in because it may be
* unavailable in certain environments and might need to be created manually with 'createRequire'
*/
function tailwindContentEntry(req) {
const packageLocaton = req.resolve('@speckle/tailwind-theme')
const packageDir = dirname(packageLocaton)
return resolve(packageDir, '**/*.{js,cjs,mjs}')
}
module.exports = { tailwindContentEntry }