stealjs / steal-less

A less plugin for StealJS
https://www.npmjs.com/package/steal-less
MIT License
4 stars 2 forks source link

Nested locate:// #14

Closed akagomez closed 8 years ago

akagomez commented 8 years ago
// src/components/foo/foo.html

<can-import from="project/components/foo/" />
// src/components/foo/foo.js

import `./foo.less`;
// src/components/foo/foo.less

@import "locate://project/less/bootstrap.less"
// src/less/bootstrap.less

@import "locate://bootstrap/less/variables.less"

Results in:

404 http://../node_modules/bootstrap/less/variables.less

It looks like the locate hook is working, but it's not being made relative to the html page.

Originally posted here: https://github.com/donejs/css/issues/40

nlundquist commented 8 years ago

The heart of this bug appears to be that when we calculate relative paths for located resources we assume the path of the importer is normalized. Including '../' in the base path causes additional '../' in the output, resulting in this bug. Working on a fix.

nlundquist commented 8 years ago

I've confirmed this is the issue and have a fix that works. Will put the change up once I get a chance to add a test for it.

akagomez commented 8 years ago

Thank you @nlundquist!

nlundquist commented 8 years ago

no problem @akagomez. when you get a chance can you try that branch and confirm it resolves your case? after that i'll merge down and make a patch release

akagomez commented 8 years ago

@nlundquist Works beautifully!