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'
15
15
import fastGlob from 'fast-glob'
16
16
import { findAtConfigPath } from '../../../lib/findAtConfigPath'
17
17
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'
19
20
20
21
/**
21
22
*
@@ -142,10 +143,20 @@ let state = {
142
143
143
144
loadConfig ( configPath , content ) {
144
145
if ( this . watcher && configPath ) {
145
- this . refreshConfigDependencies ( configPath )
146
+ this . refreshConfigDependencies ( )
146
147
}
147
148
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
+ }
149
160
150
161
// @ts -ignore
151
162
this . configBag . config = resolveConfig ( this . configBag . config , { content : { files : [ ] } } )
You can’t perform that action at this time.
0 commit comments