Skip to content

Commit 9f70367

Browse files
committed
chore(config): stop exposing cmsConfigFile directly
1 parent e14be64 commit 9f70367

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/configManager.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ class ConfigManager {
4646
this._config = options;
4747
}
4848

49-
get cmsConfigFile() {
50-
return this._cmsConfigFile;
51-
}
52-
5349
get config() {
5450
return this._config;
5551
}
@@ -66,6 +62,14 @@ class ConfigManager {
6662
return config;
6763
}
6864

65+
get cmsConfigFileName() {
66+
return this._cmsConfigFile.fileName;
67+
}
68+
69+
readCmsConfigFile() {
70+
return this._cmsConfigFile.readFile();
71+
}
72+
6973
static setConfigPaths(configObject, enforcedPath) {
7074
const newConfig = {
7175
collections: []

src/module.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ export default function NetlifyCmsModule(moduleOptions) {
132132
});
133133

134134
// Start watching config file
135-
const patterns = [Utils.r(configManager.cmsConfigFile.fileName)];
135+
const patterns = [Utils.r(configManager.cmsConfigFileName)];
136136

137137
const options = {
138138
...this.options.watchers.chokidar,
139139
ignoreInitial: true
140140
};
141141

142142
const refreshFiles = _.debounce(() => {
143-
configManager.cmsConfigFile.readFile();
143+
configManager.readCmsConfigFile();
144144
this.nuxt.renderer.netlifyWebpackDevMiddleware.invalidate();
145145
this.nuxt.renderer.netlifyWebpackHotMiddleware.publish({
146146
action: "reload"

0 commit comments

Comments
 (0)