abhai
14 November 2022
Yes. We. Can. Here's a Drupal theme with Webpack configured to transpile sass/scss to css and TypeScript to JavaScript: https://github.com/codingsasi/nephos
- Download this theme into your
themes/custom
directory. This theme is named "nephos", after the greek goddess of the internet. But you can use the bash script to change the name quite easily. - Run
npm install
. - Start working on your theme. The SCSS files are in the
scss
folder and TypeScript files are in thejs
folder. You can write code in JS as well, just remember to import it in nephos.ts file because that's the "entry". - Run
npm run build --mode=development
and the compiled files will be in thisdist
folder. - Use the bash script
change-theme-name.sh
to refactor the theme name.