You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get the css files of an entry to then pass them to a javascript that builds an iframe and adds in the iframe the css files.
I am adding EntrypointLookupInterface as a dependency and call getCssFiles of an entry that I have declared in webpack.config.js. The problem is that the function getCssFiles calls getEntryFiles that filters already returned files, resulting that some common files are not added then in my website when I call in twig {{ encore_entry_link_tags }}.
Looking at the code I cannot see any way to get the files avoiding this filtering.
There could be another function to retrieve entries without filtering, or add a parameter to getCssFiles and getJsFiles to skip filtering.
The text was updated successfully, but these errors were encountered:
Currently as a workaround to get access to the entries I did this:
use ReflectionClass;
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookupInterface;
class Test {
public function __construct(EntrypointLookupInterface $entrypointLookup){
$this->entrypointLookup = $entrypointLookup;
}
public function getCssFilesForWebpackEntry($entry){
$reflect = new ReflectionClass($this->entrypointLookup);
$method = $reflect->getMethod('getEntriesData');
$method->setAccessible(true);
$result = $method->invoke($this->entrypointLookup);
$css = [];
foreach($result['entrypoints'][$entry]['css'] as $file){
$css[] = $file;
}
return $css;
}
}
See #90 - we do need to make this possible. What about an argument to encore_entry_link_tags()? Hmm, or (because that already has several optional arguments), we might need a new function... :/ - like encore_entry_link_tags_all(). I'm not sure...
Hello,
I am trying to get the css files of an entry to then pass them to a javascript that builds an iframe and adds in the iframe the css files.
I am adding
EntrypointLookupInterface
as a dependency and callgetCssFiles
of an entry that I have declared inwebpack.config.js
. The problem is that the functiongetCssFiles
callsgetEntryFiles
that filters already returned files, resulting that some common files are not added then in my website when I call in twig{{ encore_entry_link_tags }}
.Looking at the code I cannot see any way to get the files avoiding this filtering.
There could be another function to retrieve entries without filtering, or add a parameter to
getCssFiles
andgetJsFiles
to skip filtering.The text was updated successfully, but these errors were encountered: