Webpack config and package.json missing from new LiveView project (mix phx.new app --live)

Hey all.
I’ve created a new LiveView app using mix phx.new test --live. I didn’t get any errors, I can start the server and everything seems to work fine.
However, I’m missing the webpack.config.js and package.json in the assets folder so I’m unable to add any npm packages.

I’m using the following versions on WSL Ubuntu via asdf:
erlang 24.1.2
elixir 1.12.3-otp-24
nodejs 17.0.1 (but I’ve also tried 14.18.1)

2 Likes

it’s because Phoenix 1.6 dropped webpack and npm in favor of esbuild.

If You are using the latest Phoenix, You don’t need the --live flag anymore.

There are many posts about switching to esbuild. You can also remove it, and use webpack, but You are in charge…

There is this approach where You use esbuild with npm, a post by @karolsluszniak

2 Likes

Thanks for the explainer and the link - I must have missed this change.

1 Like