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

By default look for eleventy.config.cjs and eleventy.config.js config files #1029

Closed
zachleat opened this issue Mar 20, 2020 · 11 comments · Fixed by #2464
Closed

By default look for eleventy.config.cjs and eleventy.config.js config files #1029

zachleat opened this issue Mar 20, 2020 · 11 comments · Fixed by #2464

Comments

@zachleat
Copy link
Member

zachleat commented Mar 20, 2020

Also think about a potentially breaking change for 1.0 as we want to move away from dot files and look for eleventy.config.cjs and eleventy.config.js too (file separately).

I think this will be an additional lookup instead of a replacement for .eleventy.js.

@zachleat zachleat added enhancement breaking-change This will have to be included with a major version as it breaks backwards compatibility. labels Mar 20, 2020
@zachleat zachleat added this to Needs triage in Eleventy 1.0 via automation Mar 20, 2020
@zachleat zachleat added this to To do in Support ESM and .cjs Files via automation Mar 20, 2020
@zachleat zachleat added this to the Eleventy v1.0.0 milestone Mar 20, 2020
@zachleat
Copy link
Member Author

zachleat commented Mar 20, 2020

Related .eleventy.cjs #1028

@zachleat zachleat added the needs-votes A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved. label Mar 20, 2020
@zachleat
Copy link
Member Author

This repository is now using lodash style issue management for enhancements. This means enhancement issues will now be closed instead of leaving them open.

View the enhancement backlog here. Don’t forget to upvote the top comment with 👍!

Eleventy 1.0 automation moved this from Needs triage to Closed Mar 20, 2020
Support ESM and .cjs Files automation moved this from To do to Done Mar 20, 2020
@zachleat zachleat moved this from Done to To do in Support ESM and .cjs Files Mar 20, 2020
@zachleat zachleat modified the milestones: Planning for Eleventy v1.0.0, Eleventy 1.0.0 Nov 22, 2020
@zachleat zachleat reopened this Nov 22, 2020
Eleventy 1.0 automation moved this from Closed to Needs triage Nov 22, 2020
@zachleat zachleat removed the breaking-change This will have to be included with a major version as it breaks backwards compatibility. label Nov 22, 2020
@rynz
Copy link

rynz commented Feb 24, 2021

For consistency between other .*rc.js configurations, eg: .eslintrc.js, .prettierrc.js can we please add an additional default .eleventyrc.js?

@valtlai
Copy link
Contributor

valtlai commented Feb 24, 2021

@rynz, this may not change anything, but ESLint is moving to eslint.config.js.

@rynz
Copy link

rynz commented Feb 24, 2021

@valtlai, that changes everything! Thank you for the heads up :)

@brycewray
Copy link

FWIW: in 0.12.1, manually setting the config to eleventy.config.js causes oddities with the BrowserSync config in dev mode (e.g., it doesn’t refresh the browser when CSS files are updated). Is this because of hard-coding that, one would assume, will be altered in 1.0.x to allow for eleventy.config.js rather than .eleventy.js?

@daflh
Copy link

daflh commented Jul 10, 2021

@brycewray I think it might be related to #1448 and #1568

@zachleat
Copy link
Member Author

Punting this one out of 1.0—sorry y’all!

@zachleat zachleat removed this from Needs triage in Eleventy 1.0 Aug 14, 2021
Snapstromegon added a commit to Snapstromegon/eleventy that referenced this issue Jun 29, 2022
…ult eleventy config files

Currently only .eleventy.js is supported as the default config file.

This PR implements a possible solution for multiple config file. It intentionally just implements support for multiple default config files.

The implementation might be a little flaky around unittests, but it passes all of them consistently.

A future PR should probably look into allowing usage of multiple config files at once. This only uses the first existing one.

Signed-off-by: Raphael Höser <raphael@hoeser.info>
@zachleat zachleat added the release: punted Punted out of a previous release milestone due to time constraints label Aug 15, 2022
zachleat added a commit that referenced this issue Aug 16, 2022
…ible-default-config-files

#1028 #1029 Possible first implementation for additional default eleventy config files
@zachleat zachleat moved this from To do to Done in Support ESM and .cjs Files Aug 16, 2022
@zachleat zachleat removed needs-votes A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved. release: punted Punted out of a previous release milestone due to time constraints labels Aug 16, 2022
@zachleat
Copy link
Member Author

Shipping with 2.0.0-canary.15 thanks to an excellent PR from @Snapstromegon at #2464!

@AdryAtDev
Copy link

AdryAtDev commented Jul 13, 2023

How can I tell eleventy to look for my configuration file in my configuration folder, without creating a configuration file in the root folder?

Ex:

root /
/configuration/eleventy.config.cjs
/src /...

@Snapstromegon
Copy link
Member

@AdryAtDev You can pass a --config parameter when you call 11ty: https://www.11ty.dev/docs/usage/#config-to-change-the-config-file-name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
7 participants