Skip to content

Commit

Permalink
apply load -> loadConfig changes to Oxide engine CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Mar 15, 2023
1 parent 8edb3c1 commit acaa360
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/oxide/cli/build/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import { createWatcher } from './watching'
import fastGlob from 'fast-glob'
import { findAtConfigPath } from '../../../lib/findAtConfigPath'
import log from '../../../util/log'
import { load } from '../../../lib/load-config'
import { loadConfig } from '../../../lib/load-config'
import getModuleDependencies from '../../../lib/getModuleDependencies'

/**
*
Expand Down Expand Up @@ -142,10 +143,20 @@ let state = {

loadConfig(configPath, content) {
if (this.watcher && configPath) {
this.refreshConfigDependencies(configPath)
this.refreshConfigDependencies()
}

this.configBag = load(configPath)
let config = loadConfig(configPath)
let dependencies = getModuleDependencies(configPath)
this.configBag = {
config,
dependencies,
dispose() {
for (let file of dependencies) {
delete require.cache[require.resolve(file)]
}
},
}

// @ts-ignore
this.configBag.config = resolveConfig(this.configBag.config, { content: { files: [] } })
Expand Down

0 comments on commit acaa360

Please sign in to comment.