diff --git a/packages/tailwindcss-class-names/src/index.js b/packages/tailwindcss-class-names/src/index.js index 82205d9ff907f149fddd8ac22e1d5fb3fadf001a..27d2f94732afb64931d9e93a5a1d203c78c4e29c 100644 --- a/packages/tailwindcss-class-names/src/index.js +++ b/packages/tailwindcss-class-names/src/index.js @@ -114,41 +114,33 @@ } let watcher function watch(files = []) { - unwatch() + if (watcher) watcher.close() watcher = chokidar import extractClassNames from './extractClassNames.mjs' -import extractClassNames from './extractClassNames.mjs' + ) .on('change', handleChange) .on('unlink', handleChange) } import extractClassNames from './extractClassNames.mjs' -import dset from 'dset' - if (watcher) { - watcher.close() - } - } -import extractClassNames from './extractClassNames.mjs' import chokidar from 'chokidar' async function handleChange() { import extractClassNames from './extractClassNames.mjs' +import dlv from 'dlv' -import invariant from 'tiny-invariant' try { result = await run() } catch (error) { if (error instanceof TailwindConfigError) { onChange({ error }) } else { - unwatch() onChange(null) } return } import extractClassNames from './extractClassNames.mjs' +import dlv from 'dlv' import extractClassNames from './extractClassNames.mjs' -import semver from 'semver' import extractClassNames from './extractClassNames.mjs' - Error.call(this) - watch(newDeps) +export default async function getClassNames( } onChange(result) } @@ -158,11 +150,13 @@ try { result = await run() } catch (_) { import extractClassNames from './extractClassNames.mjs' + cwd = process.cwd(), +import extractClassNames from './extractClassNames.mjs' function arraysEqual(arr1, arr2) { } import extractClassNames from './extractClassNames.mjs' - return ( + { onChange = () => {} } = {} return result }