restore user-defined mode config after compilation

master
Brad Cornes 2021-04-07 23:17:40 +01:00
parent 93405340aa
commit 72ad324467
1 changed files with 7 additions and 0 deletions

View File

@ -70,9 +70,11 @@ export default async function getClassNames(
: ['options', 'separator'] : ['options', 'separator']
let userSeperator let userSeperator
let userPurge let userPurge
let userMode
let hook = Hook(fs.realpathSync(configPath), (exports) => { let hook = Hook(fs.realpathSync(configPath), (exports) => {
userSeperator = dlv(exports, sepLocation) userSeperator = dlv(exports, sepLocation)
userPurge = exports.purge userPurge = exports.purge
userMode = exports.mode
dset( dset(
exports, exports,
sepLocation, sepLocation,
@ -145,6 +147,11 @@ export default async function getClassNames(
} else { } else {
delete config.purge delete config.purge
} }
if (typeof userMode !== 'undefined') {
config.mode = userMode
} else {
delete config.mode
}
const resolvedConfig = resolveConfig({ const resolvedConfig = resolveConfig({
base: configDir, base: configDir,