-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for importing from npm packages: @import (npm) ...
#1965
Comments
We've talked about this, I like the idea. For the sake of discussion and a working demo, see the following (these are out of date, but they still demonstrate the concept): |
I would welcome this being implemented as a plugin to begin with. |
@lukeapage does less have plugin API? |
@lukeapage I would like to add support for bower as well. Should I create a similar PR or a plugin? If plugin, can you link to docs or an existing example? |
@lukeapage nevermind, I found #1861 |
As I said on the pull request id rather npm:// and bower:// as it is environment specific not less language specific. It also means plugins just need to handle the filename, not edit the parser behaviour. |
Also have a look at the 2.0 pull request. |
and progress on this? Would really like this feature! |
Closing as supported with https://github.com/less/less-plugin-npm-import now. |
I want to propose a new feature which would allow to import less/css files from inside npm packages using Node module resolution algorithm (e.g. searching package inside
node_modules
directory in the current directory and up the tree, see Node docs for more details).The syntax I propose is:
which naturally extends import options available today. I think it would be nice to have
npm
import option to be compatible with other options such asreference
,inline
and so on.The motivation for this is simple — browserify+npm become more and more popular for developing browser applications in a modular fashion. I think it would be nice to have the same degree of modularity when writing stylesheets with less.
For the reference, there's already an implementation of
@import (npm) ...
. I think having this in core would enable much more straightforward usage and will allow to keep this feature in sync with less development.The text was updated successfully, but these errors were encountered: