Live View - generate webpack js and css assets

When I run my Phoenix Live View server locally with mix phx.server I believe it automatically triggers the required command to generate the js and css assets Live View requires.

However; in our test environments; we only use mix do deps.get, deps.compile, compile and that does not seem to generate the assets.

Is there a standalone command I can use to generate the assets. I think I came across a node ... command; but the google key words I used to find it are now escaping my recollection.

Thanks

In development we start watchers, which you can find in config/dev.exs.

For other environments, you typically run “npm run deploy” or “npm run ci” inside the assets directory. You can check assets/package.json for the available scripts.

For Phoenix v1.6, we are standardizing it behind “mix assets.deploy”.

1 Like