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

Ability to attach dependencies of a library #9

Open
philwolstenholme opened this issue Feb 25, 2019 · 3 comments
Open

Ability to attach dependencies of a library #9

philwolstenholme opened this issue Feb 25, 2019 · 3 comments

Comments

@philwolstenholme
Copy link
Collaborator

Right now, given the code below, I believe it will only be text-in-circle.js that is attached:

text-in-circle:
  js:
    dist/03-organisms/text-in-circle/text-in-circle.js: {}
  dependencies:
  - core/jquery
  - rutherford/shave

It would be great (and match Drupal's behaviour) if the listed dependencies could be included too (and linked to on the page prior to text-in-circle.js.

@philwolstenholme
Copy link
Collaborator Author

I wonder if we could piggyback on the Drupal code for resolving dependencies, similarly to how aleksip/plugin-data-transform has copied the Drupal classes for Attribute, Link etc into that plugin to make the Drupal logic available in Pattern Lab https://github.com/aleksip/plugin-data-transform/blob/develop/src/Drupal/Core/Template/Attribute.php

@waako
Copy link

waako commented Mar 13, 2019

So you are thinking using the core/lib/Drupal/Core/Asset/LibraryDiscoverParser.php and LibraryDependencyResolver.php along with other related files?

Guess would need to set relative paths to core/module libraries for dependencies?

@philwolstenholme
Copy link
Collaborator Author

Hi @waako, this isn't really an area I know a lot about, but those files look like the sort of things I had in mind.

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

No branches or pull requests

2 participants