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

14 lines
596 B
JavaScript

import { resolve, dirname } from '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'
*/
export function tailwindContentEntry(req) {
const packageLocaton = req.resolve('@speckle/tailwind-theme')
const packageDir = dirname(packageLocaton)
return resolve(packageDir, '**/*.{js,cjs,mjs}')
}