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

Support for config.cjs and/or ES6 module #2466

Open
akauppi opened this issue Jun 27, 2020 · 1 comment
Open

Support for config.cjs and/or ES6 module #2466

akauppi opened this issue Jun 27, 2020 · 1 comment

Comments

@akauppi
Copy link

akauppi commented Jun 27, 2020

Feature request

Ability to name the configuration file config.cjs (for CommonJS), and/or express configuration as an ES6 module.

What problem does this feature solve?

Currently (VuePress 1.5.2) it seems the configuration file must be config.js and that file must be given with CommonJS export syntax.

The world is in between two module eras, and projects start using ES6 modules. There is a convention about doing this in Node, defining "type": "module" in package.json (to default .js to ES6 module loading) and a recommendation of naming files explicitly to .cjs for CommonJS and .mjs for ES6.

VuePress is not acting according to such convention.

What does the proposed API look like?

One would be able to get configuration via either config.cjs, config.mjs or the default interpretation of config.js. At the least, I would like config.cjs to be found.

How should this be implemented in your opinion?

Unfortunately, I don't have insight about this.

Are you willing to work on this yourself?

I can help test a PR.

@soletan
Copy link

soletan commented Oct 3, 2021

Created PR in #2933 ... as a quick fix, you can use config.yml or config.toml when feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants