-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat: add async load of config #1618
Conversation
Thank's for your work @romulocintra ! I know it's been a while since you create the pr. I will have to check a bit about async stuff here. It's look good anyway. |
@@ -28,9 +28,12 @@ module.exports = function loadConfig (vuepressDir, bustCache = true) { | |||
} else if (fs.existsSync(configTomlPath)) { | |||
siteConfig = parseConfig(configTomlPath) | |||
} else if (fs.existsSync(configPath)) { | |||
siteConfig = require(configPath) | |||
if (typeof require(configPath).then === 'function') { | |||
siteConfig = require(configPath).then((config) => config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you can add a catch with a pretty error message it will be good for me.
use logs in shared utils package to log the error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @f3ltron not to much time to review and add a proper commit but updated with catch and logger.error message
tank's for your work ! 👍 i validate it |
Summary
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #1185
Needs more convenient tests