- Issue created by @murz
- 🇦🇲Armenia murz Yerevan, Armenia
Another alternative to this issue is to not use any transpilers, but use pure JS. But with this approach, we will get a problem with missing translations in files, included from the JS side (by import, require). And a workaround for this is to include them from the Drupal side instead, something like this -
components/my-component/my-component.component.yml
:name: My Component status: experimental group: My Components props: type: object properties: {} libraryOverrides: js: js/CatalogPage.js: { attributes: { type: 'module', defer: true } } # We have to include here all dependencies of the components used in the # template to extract translation strings from them by Drupal. # @see https://www.drupal.org/project/drupal/issues/3493106 ../../../js/templates/ProductCatalog.js: { attributes: { type: module } } ../../../js/organisms/ProductList.js: { attributes: { type: module } } ../../../js/organisms/FacetsForm.js: { attributes: { type: module } } ../../../js/molecules/Pager.js: { attributes: { type: module } } ../../../js/molecules/ProductCard.js: { attributes: { type: module } }
- 🇫🇷France nod_ Lille
I don't see what to change in Drupal core, hence setting this as a support request.
The easiest way to go about this is exclude Drupal.t from being replaced. Using a library with attribute type: module shouldn't aggregate them so you won't get aggregation or minification for theses