Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ssuhat's avatar

Envoyer and Elixir

Hi,

Currently I'm using envoyer to deploy my code.

The problem is I've tried to using elixir. I run npm installon current directory.

After that I run gulp.

It return me this error

Error: ENOENT: no such file or directory, scandir '/home/forge/example.com/releases/20160502081423/node_modules/node-sass/vendor'

I've tried using deployment hook (after composer update) and run npm install but it return me error. How can I use elixir and envoyer?

0 likes
5 replies
bobbybouwmann's avatar

You should run elixir on your development environment and then push the compiled assets to your online service ;) This way you don't have to worry about any compiling on the server

ssuhat's avatar

Hi @bobbybouwmann . But the build folder will keep changing. is that a best practice to keep adding the build folder?

ssuhat's avatar

@bobbybouwmann One more question. I've tried search at Google but no luck. Is there any way to make .gitignore for specific branch?

I want to apply like you said. Deploy the compiled version to the production branch. But at development I want to ignore it.

THanks.

bobbybouwmann's avatar

With Laravel and Elixir you only need to have the public directory in version control. So every time you compile something the public directory is updated with the new styles and javascript. You can then simply push that to the server. Even with elixir versioning enables, since the build directory will be pushed then.

This means that you don't have to push your assets to your repo or production server, since it's all compiled in your build directory ;)

1 like

Please or to participate in this conversation.