Skip to content

Commit

Permalink
Fix watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
MadeByMike committed Oct 6, 2020
1 parent c2f230c commit a26ad09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 10 additions & 6 deletions src/Eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ class Eleventy {

/** @member {String} - Holds the path to the output directory. */
this.rawOutput = output;

/** @member {Object} - tbd. */
this.watchManager = new EleventyWatch();

/** @member {Object} - tbd. */
this.watchTargets = new EleventyWatchTargets();

/** @member {Object} - tbd. */
this.eleventyServe = new EleventyServe();
}

getNewTimestamp() {
Expand Down Expand Up @@ -281,16 +290,11 @@ class Eleventy {
*/
this.isVerbose = process.env.DEBUG ? false : !this.config.quietMode;

/** @member {Object} - tbd. */
this.watchManager = new EleventyWatch();

/** @member {Object} - tbd. */
this.watchTargets = new EleventyWatchTargets();
this.watchTargets.addAndMakeGlob(this.config.additionalWatchTargets);
this.watchTargets.watchJavaScriptDependencies = this.config.watchJavaScriptDependencies;

/** @member {Object} - tbd. */
this.eleventyServe = new EleventyServe(config);
this.eleventyServe.config = config;

this.config.inputDir = this.inputDir;

Expand Down
7 changes: 4 additions & 3 deletions src/EleventyServe.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ const TemplatePath = require("./TemplatePath");
const debug = require("debug")("EleventyServe");

class EleventyServe {
constructor(templateConfig) {
this.config = templateConfig.getConfig();
}
constructor() {}

get config() {
return this.configOverride || this.config;
}

set config(config) {
this.configOverride = config;
}
Expand Down Expand Up @@ -119,6 +118,8 @@ class EleventyServe {
const browserSync = require("browser-sync");
this.server = browserSync.create();

console.log("server created");

let pathPrefix = this.getPathPrefix();

if (this.savedPathPrefix && pathPrefix !== this.savedPathPrefix) {
Expand Down
5 changes: 0 additions & 5 deletions src/UserConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,11 +360,6 @@ class UserConfig {
this.templateFormatsAdded = [];
}

console.log({
templateFormatsAdded: this.templateFormatsAdded,
templateFormats: this.templateFormats,
});

this.templateFormatsAdded = this.templateFormatsAdded.concat(
this._normalizeTemplateFormats(templateFormats)
);
Expand Down

0 comments on commit a26ad09

Please sign in to comment.