Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning that .eleventyignore entries are also reused for watching #2685

Open
zachleat opened this issue Dec 9, 2022 · 6 comments
Open

Warning that .eleventyignore entries are also reused for watching #2685

zachleat opened this issue Dec 9, 2022 · 6 comments
Labels
needs-discussion Please leave your opinion! This request is open for feedback from devs.

Comments

@zachleat
Copy link
Member

zachleat commented Dec 9, 2022

In #893 we decoupled eleventyConfig.ignores from watching with the new eleventyConfig.watchIgnores API.

However, .eleventyignore entries are still applied in both places.

Should .eleventyignore be decoupled in the same way? And .gitignore?

A few relevant docs links:

@zachleat zachleat added the needs-discussion Please leave your opinion! This request is open for feedback from devs. label Dec 9, 2022
@zachleat
Copy link
Member Author

zachleat commented Dec 9, 2022

@zachleat
Copy link
Member Author

zachleat commented Dec 9, 2022

(I am also tempted to bravely suggest removing the .eleventyignore feature altogether 😅)

@jeromecoupe
Copy link

Just tried locally. No dice. Tested with v2.0.0-canary.18

  • .gitignore ignores ./dist and ./node_modules
  • CSS and JS file built in ./dist/asssets from ./src/assets
  • no .eleventyignore file
  • added eleventyConfig.ignores.add("./src/assets/“); in config
  • added watch targets in config files for each source assets folders

No reload when changing assets source files. Repo updated to reflect changes.

@jeromecoupe
Copy link

(I am also tempted to bravely suggest removing the .eleventyignore feature altogether 😅)

For what it's worth, I am all for having features centralised in one place. API sound good to me.

@jeromecoupe
Copy link

jeromecoupe commented Dec 9, 2022

Getting somewhere here, methink. Seems I had a couple of issues / misunderstandings.

  1. Builds are now triggered when deleting .eleventyignore and moving the ignore entries to API as per the changes in Allow addWatchTarget to watch ignored files #893
  2. The other problem was that the builds seem to be faster than my asset pipelines (esbuild for JS and Sass for CSS). Adding eleventyConfig.setWatchThrottleWaitTime(200); seems to do the trick. Can see my CSS and JS changes now.

Full working config file

module.exports = function (eleventyConfig) {
  // ignore folders
  eleventyConfig.ignores.add("./src/assets/");

  // watch targets (add small wait time before rebuild, tweak accordingly)
  eleventyConfig.setWatchThrottleWaitTime(200);
  eleventyConfig.addWatchTarget("./src/assets/scss/");
  eleventyConfig.addWatchTarget("./src/assets/js/");

  // server options
  eleventyConfig.setServerOptions({
    port: 3000,
  });

  // override base config
  return {
    dir: {
      input: "./src",
      output: "./dist",
      markdownTemplateEngine: "njk",
    },
  };
};

Relevant debug output (serve)

Eleventy Watching for changes to: [ './src/assets/scss/**/*', './src/assets/js/**/*', './src/**/*.liquid', './src/**/*.ejs', './src/**/*.md', './src/**/*.hbs', './src/**/*.mustache', './src/**/*.haml', './src/**/*.pug', './src/**/*.njk', './src/**/*.html', './src/**/*.11ty.js', './src/**/*.11ty.cjs', './src/_includes/**', './src/_data/**', './.eleventy.js', './eleventy.config.js', './eleventy.config.cjs', './src/**/*.json', './src/**/*.11tydata.cjs', './src/**/*.11tydata.js' ] +3ms
Eleventy Ignoring watcher changes to: [ 'node_modules/**', 'dist/**', './**/node_modules/**', './.git/**' ] +0ms

Full debug output (serve)

Eleventy:cmd command: eleventy { _: [], quiet: null, version: false, watch: false, dryrun: false, help: false, serve: true, passthroughall: false, incremental: false } +0ms
Eleventy:EventBus Setting up global EventBus. +0ms
Eleventy:UserConfig Resetting EleventyConfig to initial values. +0ms
Eleventy:UserConfig Adding universal filter 'slug' +5ms
Eleventy:UserConfig Adding universal filter 'slugify' +1ms
Eleventy:UserConfig Adding universal filter 'url' +0ms
Eleventy:UserConfig Adding universal filter 'log' +0ms
Eleventy:UserConfig Adding universal filter 'serverlessUrl' +0ms
Eleventy:UserConfig Adding universal filter 'getCollectionItem' +0ms
Eleventy:UserConfig Adding universal filter 'getPreviousCollectionItem' +0ms
Eleventy:UserConfig Adding universal filter 'getNextCollectionItem' +0ms
Eleventy:TemplateConfig rootConfig { templateFormats: [ 'liquid',   'ejs', 'md',       'hbs', 'mustache', 'haml', 'pug',      'njk', 'html',     '11ty.js' ], pathPrefix: '/', markdownTemplateEngine: 'liquid', htmlTemplateEngine: 'liquid', dataTemplateEngine: false, htmlOutputSuffix: '-o', jsDataFileSuffix: '.11tydata', keys: { package: 'pkg', layout: 'layout', permalink: 'permalink', permalinkRoot: 'permalinkBypassOutputDir', engineOverride: 'templateEngineOverride', computed: 'eleventyComputed' }, dir: { input: '.', includes: '_includes', data: '_data', output: '_site' }, handlebarsHelpers: {}, nunjucksFilters: {} } +0ms
Eleventy:TemplateConfig Setting pathPrefix to '/' +1ms
Eleventy Setting process.env.ELEVENTY_ROOT: '/Users/jeromecoupe/data/sandboxes/test-11ty-dev-server' +0ms
Eleventy:TemplateConfig Merging config with .eleventy.js +1ms
Eleventy:TemplateConfig overrides: { pathPrefix: '/' } +2ms
Eleventy:TemplateConfig Current configuration: { pathPrefix: '/', markdownTemplateEngine: 'liquid', htmlTemplateEngine: 'liquid', dataTemplateEngine: false, htmlOutputSuffix: '-o', jsDataFileSuffix: '.11tydata', keys: { package: 'pkg', layout: 'layout', permalink: 'permalink', permalinkRoot: 'permalinkBypassOutputDir', engineOverride: 'templateEngineOverride', computed: 'eleventyComputed' }, dir: { input: './src', includes: '_includes', data: '_data', output: './dist', markdownTemplateEngine: 'njk' }, handlebarsHelpers: { slug: [Function (anonymous)], slugify: [Function (anonymous)], url: [Function (anonymous)], log: [Function (anonymous)], serverlessUrl: [Function (anonymous)], getCollectionItem: [Function (anonymous)], getPreviousCollectionItem: [Function (anonymous)], getNextCollectionItem: [Function (anonymous)] }, nunjucksFilters: { slug: [Function (anonymous)], slugify: [Function (anonymous)], url: [Function (anonymous)], log: [Function (anonymous)], serverlessUrl: [Function (anonymous)], getCollectionItem: [Function (anonymous)], getPreviousCollectionItem: [Function (anonymous)], getNextCollectionItem: [Function (anonymous)] }, templateFormats: [ 'liquid',   'ejs', 'md',       'hbs', 'mustache', 'haml', 'pug',      'njk', 'html',     '11ty.js' ], transforms: {}, linters: {}, globalData: {}, layoutAliases: {}, passthroughCopies: {}, liquidOptions: {}, liquidTags: {}, liquidFilters: { slug: [Function (anonymous)], slugify: [Function (anonymous)], url: [Function (anonymous)], log: [Function (anonymous)], serverlessUrl: [Function (anonymous)], getCollectionItem: [Function (anonymous)], getPreviousCollectionItem: [Function (anonymous)], getNextCollectionItem: [Function (anonymous)] }, liquidShortcodes: {}, liquidPairedShortcodes: {}, nunjucksEnvironmentOptions: {}, nunjucksPrecompiledTemplates: {}, nunjucksAsyncFilters: {}, nunjucksTags: {}, nunjucksGlobals: {}, nunjucksAsyncShortcodes: {}, nunjucksShortcodes: {}, nunjucksAsyncPairedShortcodes: {}, nunjucksPairedShortcodes: {}, handlebarsShortcodes: {}, handlebarsPairedShortcodes: {}, javascriptFunctions: { slug: [Function (anonymous)], slugify: [Function (anonymous)], url: [Function (anonymous)], log: [Function (anonymous)], serverlessUrl: [Function (anonymous)], getCollectionItem: [Function (anonymous)], getPreviousCollectionItem: [Function (anonymous)], getNextCollectionItem: [Function (anonymous)] }, pugOptions: {}, ejsOptions: {}, markdownHighlighter: null, libraryOverrides: {}, dynamicPermalinks: true, useGitIgnore: true, ignores: Set(3) { '**/node_modules/**', '.git/**', './src/assets/' }, watchIgnores: Set(2) { '**/node_modules/**', '.git/**' }, dataDeepMerge: true, watchJavaScriptDependencies: true, additionalWatchTargets: [ './src/assets/scss/**/*', './src/assets/js/**/*' ], serverOptions: { port: 3000 }, chokidarConfig: {}, watchThrottleWaitTime: 200, frontMatterParsingOptions: undefined, dataExtensions: Map(0) {}, extensionMap: Set(0) {}, quietMode: false, events: AsyncEventEmitter { _events: [Object: null prototype] {}, _eventsCount: 0, _maxListeners: undefined, [Symbol(kCapture)]: false }, benchmarkManager: BenchmarkManager { benchmarkGroups: { Configuration: [BenchmarkGroup], Aggregate: [BenchmarkGroup] }, isVerbose: true, start: 228.8373749256134 }, plugins: [], useTemplateCache: true, precompiledCollections: {}, dataFilterSelectors: Set(0) {}, libraryAmendments: {}, serverPassthroughCopyBehavior: 'passthrough', urlTransforms: [] } +0ms
Eleventy Eleventy warm up time (in ms) 241.71745800971985 +5ms
Eleventy:TemplatePassthroughManager Resetting counts to 0 +0ms
Eleventy:EleventyFiles .gitignore ignoring: ./node_modules/** +0ms
Eleventy:EleventyFiles .gitignore ignoring: ./dist/** +0ms
Eleventy Directories:
Eleventy Input (Dir): ./src
Eleventy Input (File): undefined
Eleventy Data: src/_data
Eleventy Includes: src/_includes
Eleventy Layouts: undefined
Eleventy Output: ./dist
Eleventy Template Formats: liquid,ejs,md,hbs,mustache,haml,pug,njk,html,11ty.js
Eleventy Verbose Output: false +2ms
Eleventy:EleventyFiles Searching for: [ './src/**/*.liquid', './src/**/*.ejs', './src/**/*.md', './src/**/*.hbs', './src/**/*.mustache', './src/**/*.haml', './src/**/*.pug', './src/**/*.njk', './src/**/*.html', './src/**/*.11ty.js', './src/**/*.11ty.cjs' ] +12ms
Eleventy:TemplateWriter Found: [ './src/content/pages/index.njk' ] +0ms
Eleventy:TemplatePassthroughManager TemplatePassthrough copy started. +18ms
Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API paths: {} +0ms
Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API normalized paths: [] +0ms
Eleventy:TemplateData Using '.11tydata' to find data files. +0ms
Eleventy:TemplateData getLocalDataPaths('./src/content/pages/index.njk'): [ './src/content/pages/index.11tydata.js', './src/content/pages/index.11tydata.cjs', './src/content/pages/index.11tydata.json', './src/content/pages/index.json', './src/content/pages/pages.11tydata.js', './src/content/pages/pages.11tydata.cjs', './src/content/pages/pages.11tydata.json', './src/content/pages/pages.json', './src/content/content.11tydata.js', './src/content/content.11tydata.cjs', './src/content/content.11tydata.json', './src/content/content.json', './src/src.11tydata.js', './src/src.11tydata.cjs', './src/src.11tydata.json', './src/src.json' ] +0ms
Eleventy:TemplateWriter ./src/content/pages/index.njk begun adding to map. +1ms
Eleventy:TemplatePassthroughManager TemplatePassthrough copy finished. Current count: 0 +2ms
Eleventy:Template Template date: using file’s 'birthtimeMs' for './src/content/pages/index.njk' of 2022-09-20T11:20:04.061Z (from 1663672804061.4211) +0ms
Eleventy:TemplateMap Caching collections objects. +0ms
Eleventy:Template Rendering permalink for './src/content/pages/index.njk': index.html becomes 'index.html' +1ms
Eleventy:TemplateMap Collection: collections.all size: 1 +1ms
Eleventy:TemplateMap Collection: collections.all size: 1 +0ms
Eleventy:TemplateWriter Template map created. +22ms
Eleventy:Logger Writing ./dist/index.html from ./src/content/pages/index.njk +0ms
Eleventy:Template ./dist/index.html written.. +5ms
Eleventy:Logger Benchmark      9ms  16%     2× (Aggregate) Searching the file system +1ms
Eleventy:Benchmark Benchmark      9ms  16%     2× (Aggregate) Searching the file system +0ms
Eleventy:Benchmark Benchmark      2ms   4%     1× (Aggregate) Template Compile +0ms
Eleventy:Benchmark Benchmark      2ms   4%     1× (Aggregate) > Compile > ./src/content/pages/index.njk +0ms
Eleventy:Benchmark Benchmark      1ms   2%     1× (Aggregate) Render +0ms
Eleventy:Benchmark Benchmark      1ms   2%     1× (Aggregate) > Render > ./src/content/pages/index.njk +0ms
[11ty] Wrote 1 file in 0.04 seconds (v2.0.0-canary.18)
Eleventy Finished writing templates. +41ms
Eleventy 
Eleventy       Getting frustrated? Have a suggestion/feature request/feedback?
Eleventy       I want to hear it! Open an issue: https://github.com/11ty/eleventy/issues/new +0ms
Eleventy Watching for changes to: [ './src/assets/scss/**/*', './src/assets/js/**/*', './src/**/*.liquid', './src/**/*.ejs', './src/**/*.md', './src/**/*.hbs', './src/**/*.mustache', './src/**/*.haml', './src/**/*.pug', './src/**/*.njk', './src/**/*.html', './src/**/*.11ty.js', './src/**/*.11ty.cjs', './src/_includes/**', './src/_data/**', './.eleventy.js', './eleventy.config.js', './eleventy.config.cjs', './src/**/*.json', './src/**/*.11tydata.cjs', './src/**/*.11tydata.js' ] +3ms
Eleventy Ignoring watcher changes to: [ 'node_modules/**', 'dist/**', './**/node_modules/**', './.git/**' ] +0ms
Eleventy:Benchmark Benchmark      5ms NaN%     1× (Watch) Start up --watch +5ms
Eleventy:Benchmark Benchmark      2ms NaN%     1× (Watch) Watching JavaScript Dependencies (disable with `eleventyConfig.setWatchJavaScriptDependencies(false)`) +0ms
[11ty] Watching…
Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API paths: {} +27ms
Eleventy:TemplatePassthroughManager `addPassthroughCopy` config API normalized paths: [] +0ms
Eleventy Ignoring watcher changes to: [ 'node_modules/**', 'dist/**', './**/node_modules/**', './.git/**' ] +2ms
Eleventy:Logger Server at http://localhost:3000/ +27ms

@zachleat
Copy link
Member Author

zachleat commented Dec 9, 2022

Cross posting the other issue 11ty/eleventy-dev-server#42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-discussion Please leave your opinion! This request is open for feedback from devs.
Projects
None yet
Development

No branches or pull requests

2 participants