Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Throw if --config is specified but the file is not found #3373

@LeaVerou

Description

@LeaVerou

I periodically run into this, and it can be quite annoying, sometimes even destructive.

My 11ty build command usually looks like this:

npx @11ty/eleventy --config=somedir/eleventy.js 

The current behavior is that if 11ty doesn't find the file specified, it still builds, but using the default config.
This can create a lot of trash in the directory structure that I then need to remove manually.

I’d be inclined to consider it a bug: if I’ve explicitly specified a config file, I literally never want to build with the default config. If the config file I specified is not found, that’s a genuine error condition, and 11ty should just let me know and exit early (possibly by helpfully outputting CWD too or the full path it was trying).

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking-changeThis will have to be included with a major version as it breaks backwards compatibility.enhancementfeature: CLIRelated to command line flags/usage/features

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions