Skip to content

Commit cfef652

Browse files
committed
apply load -> loadConfig changes to Oxide engine CLI
1 parent e492e72 commit cfef652

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/oxide/cli/build/plugin.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import { createWatcher } from './watching'
1515
import fastGlob from 'fast-glob'
1616
import { findAtConfigPath } from '../../../lib/findAtConfigPath'
1717
import log from '../../../util/log'
18-
import { load } from '../../../lib/load-config'
18+
import { loadConfig } from '../../../lib/load-config'
19+
import getModuleDependencies from '../../../lib/getModuleDependencies'
1920

2021
/**
2122
*
@@ -142,10 +143,20 @@ let state = {
142143

143144
loadConfig(configPath, content) {
144145
if (this.watcher && configPath) {
145-
this.refreshConfigDependencies(configPath)
146+
this.refreshConfigDependencies()
146147
}
147148

148-
this.configBag = load(configPath)
149+
let config = loadConfig(configPath)
150+
let dependencies = getModuleDependencies(configPath)
151+
this.configBag = {
152+
config,
153+
dependencies,
154+
dispose() {
155+
for (let file of dependencies) {
156+
delete require.cache[require.resolve(file)]
157+
}
158+
},
159+
}
149160

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

0 commit comments

Comments
 (0)