File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ import { createWatcher } from './watching'
1515import fastGlob from 'fast-glob'
1616import { findAtConfigPath } from '../../../lib/findAtConfigPath'
1717import 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 : [ ] } } )
You can’t perform that action at this time.
0 commit comments