lasso-js / lasso

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

css urls resolved incorrectly with multiple pages when bundling disabled #148

Closed yomed closed 8 years ago

yomed commented 8 years ago

(This issue only occurs with bundling disabled)

My app has several different pages defined with unique <lasso-page name="appName-pageName" /> tags. Each page includes a header component which has a less file. That less file references a font in a url.

When I load a page the css file path will look like: /static/appName-pageName/lasso-less.css

The included url will be: src: url('appName$1.0.0/src/component/header/font.woff2');

The first page thats gets loaded works fine, and the font file can be seen locally in /static/appName-pageName/appName$1.0.0/src/component/header/font.woff2

For any other page that gets loaded afterwards, the font url in the css is the same as above. However, the css will be loaded from /static/appName-otherPageName/lasso-less.css, so the font file 404s when looking for it in /static/appName-otherPageName/appName$1.0.0/src/component/header/font.woff2. The font is not copied into the static/appName-otherPageName folder.

Am I missing something? Or is there a recommend workaround here? I had assumed the pages should all have unique names, but it looks like it's interfering with the url resolution in lasso.

patrick-steele-idem commented 8 years ago

I haven't had a chance to take a look yet. I should have a chance this morning.

patrick-steele-idem commented 8 years ago

This has been fixed and a new version has been published: lasso@2.5.5

Thanks for reporting the problem and please let me know if you still see issues.

yomed commented 8 years ago

Works great, thanks for the fix!