don't show init errors

master
Brad Cornes 2021-05-04 14:49:13 +01:00
parent 3e3cfd418f
commit c6c2abf15e
1 changed files with 14 additions and 15 deletions

View File

@ -36,9 +36,9 @@ import chokidar from 'chokidar'
import findUp from 'find-up' import findUp from 'find-up'
import minimatch from 'minimatch' import minimatch from 'minimatch'
import resolveFrom, { setPnpApi } from './util/resolveFrom' import resolveFrom, { setPnpApi } from './util/resolveFrom'
import postcssFallback, { Result } from 'postcss' import { /*postcssFallback,*/ Result } from 'postcss'
import tailwindcssFallback from 'tailwindcss' // import tailwindcssFallback from 'tailwindcss'
import resolveConfigFallback from 'tailwindcss/resolveConfig' // import resolveConfigFallback from 'tailwindcss/resolveConfig'
import Module from 'module' import Module from 'module'
import Hook from './lib/hook' import Hook from './lib/hook'
import semver from 'semver' import semver from 'semver'
@ -307,7 +307,7 @@ async function createProjectService(
.map(path.normalize) .map(path.normalize)
if (!configPath) { if (!configPath) {
throw Error('No config file found.') throw new SilentError('No config file found.')
} }
console.log(`Found Tailwind CSS config file: ${configPath}`) console.log(`Found Tailwind CSS config file: ${configPath}`)
@ -438,18 +438,17 @@ async function createProjectService(
} }
} catch (_) {} } catch (_) {}
} catch (error) { } catch (error) {
console.log(error) throw new SilentError(error.message)
// throw new SilentError(error.message)
// TODO: force mode // TODO: force mode
tailwindcss = tailwindcssFallback // tailwindcss = tailwindcssFallback
resolveConfigFn = resolveConfigFallback // resolveConfigFn = resolveConfigFallback
postcss = postcssFallback // postcss = postcssFallback
applyComplexClasses = require('tailwindcss/lib/lib/substituteClassApplyAtRules') // applyComplexClasses = require('tailwindcss/lib/lib/substituteClassApplyAtRules')
tailwindcssVersion = '2.0.3' // tailwindcssVersion = '2.0.3'
postcssVersion = '8.2.6' // postcssVersion = '8.2.6'
console.log( // console.log(
`Failed to load workspace modules. Initializing with tailwindcss v${tailwindcssVersion}` // `Failed to load workspace modules. Initializing with tailwindcss v${tailwindcssVersion}`
) // )
} }
state.configPath = configPath state.configPath = configPath