Hello,
I'm currently doing a project and want to serve an additional directory for static files like images to use. Now I know that defining publicPath should help me with that, the problem is, it's already in use like so:
github.com/mdick1611/simple-single-spa-webpack-ex…
The dist folder is being generated at runtime by the Dev server. I would like to serve an additional folder to serve images and other static files like this project does it:
github.com/CanopyTax/single-spa-examples
Yet I can't figure out how the images folder in the above example is being served.
Any tips?
Lorefnon
Open Web Enthusiast
The contentBase in that configuration is '.' so everything under the root directory is served by webpack dev server.
So it is not really serving static assets from two separate directories.
However, if you really want to serve static assets from multiple directories, you can do it by injecting express static middleware through devServer.before (or after) hook. Webpack dev server is basically an express server, so you can inject any express middlewares into that.