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(core): allow sourcing from multiple static directories #4095
feat(core): allow sourcing from multiple static directories #4095
Conversation
|
[V1] Deploy preview failure Built without sensitive environment variables with commit b4423b0 https://app.netlify.com/sites/docusaurus-1/deploys/600d08435d5ff20009fbd5ed |
|
Size Change: 0 B Total Size: 28.8 kB
|
| Filename | Size | Change |
|---|---|---|
website/build/blog/2017/12/14/introducing-docusaurus/index.html |
21.7 kB | 0 B |
website/build/docs/introduction/index.html |
180 B | 0 B |
website/build/index.html |
6.88 kB | 0 B |
|
|
Lighthouse ran on https://deploy-preview-4095--docusaurus-2.netlify.app/ |
This comment has been minimized.
This comment has been minimized.
| @@ -187,17 +186,17 @@ export default async function start( | |||
| // Reduce log verbosity, see https://github.com/facebook/docusaurus/pull/5420#issuecomment-906613105 | |||
| stats: 'summary', | |||
| }, | |||
| static: { | |||
| static: siteConfig.staticDirectories.map((dir) => ({ | |||
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.
oh, hopefully they allow an array here
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.
Yeah, they do:
https://webpack.js.org/configuration/dev-server/#directory
https://webpack.js.org/plugins/copy-webpack-plugin/#root
The one thing I'm slightly worried about though is path collisions. I don't know if any warning should be given in that case
Yes, realized that
I'd always used One thing I didn't particularly like about the MDX loader is it converts static paths to require calls. Before I delve into the internals, as a user, I always thought that I was referencing a URL path with |
Oh yes didn't think about that
This is important so that assets enter the Webpack pipeline instead of just being referenced strings. This leads to assets being hashed, providing better long-term caching. And also we might have a better image infra someday, allowing you to use ideal image on markdown files with simple md syntax. Some image-heavy docs have annoying image-related layout shifts atm (can probably be solved with width/height in the short term anyway) |
This is a WIP