He showed the client a preview. The carousel that used to stutter on scroll now ran at 120fps. The CLS (Cumulative Layout Shift) score went from 0.45 to 0.02.
global-scripts: js: dist/scripts/index.js: preprocess: true, minified: true dependencies: - core/drupal - core/once No more $(document).ready() . He used the new once() library to prevent rebinding and wrote vanilla JavaScript:
Monday morning, the editors logged in. The admin UI was untouched. But the front end? It felt like a new website. The designers could now edit a single .css file inside a component folder without fear of breaking the header. The developers thanked him for removing jQuery.
On Sunday night, Luca ran the final build. He used Drupal 10’s new auto-setup CLI to spin up a test environment, ran phpunit on his custom theme settings, and pushed the changes.
Luca closed his laptop, poured one last espresso, and looked out the window. Another legacy system, modernized. Another team, liberated.
He replaced it with a modern, lean setup. He wrote a custom theme.libraries.yml that imported a single ES6 entry point:
npm init -y npm install tailwindcss postcss autoprefixer --save-dev Then, he enabled the new, experimental single_directory_components module that had just landed in Drupal 10.3. Instead of scattering template, CSS, and JS across three different folders, he created a new directory: components/ .
His mission was clear: modernize it without breaking the live site for more than a weekend.