lasso-js / lasso

Advanced JavaScript module bundler, asset pipeline and optimizer
580 stars 75 forks source link

urlPrefix: "./" or "./static/" cause serveStatic to not serve at any url #305

Open yiays opened 4 years ago

yiays commented 4 years ago

As far as I can tell, no static URLs are valid or reachable if urlPrefix begins with a .. Though it might have something to do with my use case;

I'm writing my website in an environment where storing the website on the root is impossible, but express thinks it's serving the root. Eg. localhost:80/express/ is translated to localhost:3000/ before the express server sees it. This means the default behaviour of pointing to static at /static/ is impossible. I need to host static at localhost:3000/static/ while telling the browser to fetch static at localhost:80/express/static/.

Setting the urlPrefix to "./static" should fix this, but it doesn't. Nothing is served at localhost:3000/static/.