My theme documention.libraries.yml file is defined as follows :
global-styling:
version: VERSION
css:
base:
styles/dist/styles.css: {}
tocbot:
js:
libraries/tocbot/tocbot.js: {}
js/tocInit.js: {}
css:
layout:
libraries/tocbot/tocbot.css: {}
layout_tweaksLib:
js:
js/layout_tweaks.js: {}
My custom module implements a custom template which also requires the theme functionality defined in tocInit.js. So I'm trying to include the tocbot library from my theme in my module.
I have tried including a dependencies clause in my_module.libraries.yml file, resulting in the following :
my_module:
js:
js/my-module.js: {}
dependencies:
- documentation/tocbot
css:
component:
css/my-module.css: {}
However, the tocInit.js script is not being loaded on the modules' custom template.
I would appreciate some help, please.