Skip to content

Commit

Permalink
fix(build): fix various rebuild errors
Browse files Browse the repository at this point in the history
Remove duplicate file watcher on `extensionsDir`
Only read user cms config when it changes
Greatly improve rebuild time

fixes #7, closes #9, fixes #10
  • Loading branch information
medfreeman committed Sep 9, 2017
1 parent c4107f2 commit 229a257
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export default function NetlifyCmsModule(moduleOptions) {
const config = configManager.config;

const ADMIN_PATH = config.adminPath;
const EXTENSIONS_DIR = config.extensionsDir;
const BUILD_DIR = config.buildDir;

// This will be called once when builder started
Expand Down Expand Up @@ -119,10 +118,7 @@ export default function NetlifyCmsModule(moduleOptions) {
});

// Start watching config file
const patterns = [
Utils.r(configManager.cmsConfigFile.fileName),
Utils.r(EXTENSIONS_DIR)
];
const patterns = [Utils.r(configManager.cmsConfigFile.fileName)];

const options = {
...this.options.watchers.chokidar,
Expand All @@ -131,7 +127,6 @@ export default function NetlifyCmsModule(moduleOptions) {

const refreshFiles = _.debounce(() => {
configManager.cmsConfigFile.readFile();
debug(`Rebuilding...`);
this.nuxt.renderer.netlifyWebpackDevMiddleware.invalidate();
}, 200);

Expand Down

0 comments on commit 229a257

Please sign in to comment.