Public folder broken in devserver
See original GitHub issueBug Report
Describe the bug
I think https://github.com/pedronauck/docz/commit/4157e054393c532e0e51605ad2186ac5dce1e19d broke public assets folder in dev-mode. Previously the public folder was hosted at /public
, now it is used publicDir
(so it is hosted at /
).
See the difference between: https://github.com/pedronauck/docz/commit/4157e054393c532e0e51605ad2186ac5dce1e19d#diff-0a3cd3c257db10b0bb4b70618def4ef6R18 https://github.com/pedronauck/docz/commit/4157e054393c532e0e51605ad2186ac5dce1e19d#diff-0a3cd3c257db10b0bb4b70618def4ef6L47
To Reproduce
- In
doczrc.js
, setpublic: '/public'
. - Add an image:
![](/public/test.png)
- Build with
docz build
(everything works as expected) - Build with
docz dev
The image won’t work, since it’s not found at /public/test.png
. It is instead hosted at /test.png
.
Expected behavior
The public folder should be hosted the same way in both docz dev
and docz build
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Public folder broken in devserver · Issue #528 · doczjs/docz
I think 4157e05 broke public assets folder in dev-mode. Previously the public folder was hosted at /public , now it is used publicDir...
Read more >Having troubles with Webpack Dev Server settings
What I would like to do is to make Webpack Dev Server serve index.html from the src folder, but to request static assets...
Read more >DevServer - webpack
devServer : { static: { directory: path.join(__dirname, 'public'), } ... This option is ignored for Node 15.0.0 and above, as spdy is broken...
Read more >Webpack — Understanding the 'publicPath' mystery - Medium
We have the following folder structure in place. ... Basically whenever the path config is missing, webpack-dev-server considers it's values ...
Read more >HTML and Static Assets - Vue CLI
The file public/index.html is a template that will be processed with ... Any static assets placed in the public folder will simply be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ran into the same issue, so made a PR: https://github.com/pedronauck/docz/pull/614/commits
This does not only seem to be a Windows issue, I’m facing the exact same on OSX (and have it fixed once I apply the appropriate fix).