add some basic initialisation logs

master
Brad Cornes 2020-12-01 19:03:31 +00:00
parent 85fb953d0a
commit 340336ed99
1 changed files with 5 additions and 1 deletions

View File

@ -52,6 +52,7 @@ export default async function getClassNames(
invariant(configPaths.length > 0, 'No Tailwind CSS config found.') invariant(configPaths.length > 0, 'No Tailwind CSS config found.')
const configPath = configPaths[0] const configPath = configPaths[0]
console.log(`Found Tailwind config file: ${configPath}`)
const configDir = path.dirname(configPath) const configDir = path.dirname(configPath)
const tailwindBase = path.dirname( const tailwindBase = path.dirname(
resolveFrom(configDir, 'tailwindcss/package.json') resolveFrom(configDir, 'tailwindcss/package.json')
@ -59,6 +60,7 @@ export default async function getClassNames(
postcss = importFrom(tailwindBase, 'postcss') postcss = importFrom(tailwindBase, 'postcss')
tailwindcss = importFrom(configDir, 'tailwindcss') tailwindcss = importFrom(configDir, 'tailwindcss')
version = importFrom(configDir, 'tailwindcss/package.json').version version = importFrom(configDir, 'tailwindcss/package.json').version
console.log(`Found tailwindcss v${version}: ${tailwindBase}`)
try { try {
// this is not required // this is not required
@ -193,7 +195,9 @@ export default async function getClassNames(
let result let result
try { try {
result = await run() result = await run()
} catch (_) { console.log('Initialised successfully.')
} catch (error) {
console.error('Failed to initialise:', error)
return null return null
} }