Skip to content
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 node module imports in addUrlDependency #2438

Closed
DeMoorJasper opened this issue Dec 19, 2018 · 1 comment
Closed

Support node module imports in addUrlDependency #2438

DeMoorJasper opened this issue Dec 19, 2018 · 1 comment

Comments

@DeMoorJasper
Copy link
Member

DeMoorJasper commented Dec 19, 2018

🙋 feature request

addUrlDependency, currently does not support node modules properly afaik.

I can implement this myself, just wondering what the syntax should be for this kind of import.

Example of where this would be usefull

.something {
   background-image: url('node_module/icon.svg');
}

🤔 Expected Behavior

addUrlDependency should be able to import node_modules

😯 Current Behavior

addUrlDependency can't import node_modules

💁 Possible Solution

Do something similar to how css imports work
~node_module => node_module
~/path/file => root path

🔦 Context

Trying to import an icon from an icon package in a monorepo.

💻 Examples

.searchbar {
  background: transparent;
  border: none;
  padding: 10px 20px 10px 50px;
  border-radius: 25px;
  color: $black;
  width: 100%;
  font-size: $font-size-14;

  /* This does not work atm */
  background-image: url("~@zf/icons/icons/search-icon.svg");
  background-repeat: no-repeat;
  background-size: 20px;
  background-position: 15px center;
}
@devongovett
Copy link
Member

I think we are planning to support npm: protocol URLs in v2, so going to close this in favor of #3492 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants