From 6659228975393fb583268b50c2274d082a159072 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Wed, 24 Jun 2020 13:47:55 +0100 Subject: [PATCH] use realpath for config require hook fixes case where config is a symlink --- src/class-names/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/class-names/index.js b/src/class-names/index.js index b1d3794..88dd419 100644 --- a/src/class-names/index.js +++ b/src/class-names/index.js @@ -12,6 +12,7 @@ import getVariants from './getVariants' import resolveConfig from './resolveConfig' import * as util from 'util' import * as path from 'path' +import * as fs from 'fs' import { getUtilityConfigMap } from './getUtilityConfigMap' import glob from 'fast-glob' import normalizePath from 'normalize-path' @@ -79,7 +80,7 @@ export default async function getClassNames( : ['options', 'separator'] let userSeperator let userPurge - let hook = Hook(configPath, (exports) => { + let hook = Hook(fs.realpathSync(configPath), (exports) => { userSeperator = dlv(exports, sepLocation) userPurge = exports.purge dset(exports, sepLocation, '__TAILWIND_SEPARATOR__')