1

I'm developing a theme in Drupal 8. This is my theme.libraries.yml file:

default:
 version: 1.x
 css:
  theme:
   css/bootstrap.css: {}
   css/style.css: {}
   css/font-awesome.min.css: {}
   css/animate.min.css: {}
 js:
    js/galip.js: {}

When I try to view the source of the front page page, I see the JavaScript files like ready.min.js. jquery.min.js, jquery.once.min.js which I don't see in the login page and other pages.

Why is this happening? How do I include the core JavaScript files in all pages?

1 Answer 1

4

Drupal 8 adds little to no javascript by default, and thankfully doesn't force jQuery on us any more :)

You need to declare your dependencies explicitly:

default:
 version: 1.x
 css:
  theme:
   css/bootstrap.css: {}
   css/style.css: {}
   css/font-awesome.min.css: {}
   css/animate.min.css: {}
 js:
    js/galip.js: {}
 dependencies:
    - core/jquery
    - core/jquery.once
    - etc...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.