Tailwind Stylesheet Generation
For Hyvä projects deployed with capistrano-magento2, if the production stylesheet is not kept in version control, there are a few additional steps required to generate it during deployment.
Create a file named
%MAGENTOPROJECTROOT%/lib/capistrano/tasks with the following content:
Then you need to set a variable in your
namespace :deploy do desc 'Build tailwindCSS' task :hyva_tailwind_build do on roles(:all) do fetch(:hyva_tailwind_paths, ).each do |tailwind_path| within release_path + tailwind_path do execute :npm, :ci execute :npm, :run, "build-prod" end end end end end
To build the production stylesheet, you need to have node and npm installed on your server.
Optional: Change node version using NVM
If you need to switch node version (for i.e. using different node version then default) you can add https://github.com/koenpunt/capistrano-nvm
Add the module to the Gemfile:
Add the module to the Capfile:
Add the settings to