"./_hooks" directory in production

Hi I’m using Surface, and from what I understood from the docs the ./_hooks" is generated automaticaly. And that directory is not being commited.

So if I delete that directory and run:

mix assets.deploy

I get:

 > js/app.js:17:18: error: Could not resolve "./_hooks"
    17 │ import Hooks from "./_hooks"

And this is happening on the deployments.

So the question is how do I generate that or what do I need to run before running the mix assets.deploy so that the folder is there?

or if my understanding is wrong.

Thanks

You need to run mix compile and have the surface compiler configured in mix.exs.

def project do
  [
   ...
    compilers: [:gettext] ++ Mix.compilers() ++ [:surface],
  ]
end
1 Like