code

code

What is webpack exactly used for in Phoenix?

Thanks in advance.

Most Liked

NobbZ

NobbZ

Building assets.

From all those files you have in assets it creates JavaScript files, images, CSS and more and sorts them into appropriate sub folders in priv/static.

NobbZ

NobbZ

Yes, you can, but it will probably require a lot of work, and that after any change you do to your assets.

And even though I generally share the opinion to reduce runtime dependencies to a reasonable amount, I’m less strict with dev-time dependencies. And webpack is not there anymore at runtime. It builds your assets once and then is gone from your final artifacts.

marsell

marsell

If you don’t have a lot of client-side JS and CSS, you can skip webpack entirely.

See this guy.

Last Post!

derek-zhou

derek-zhou

I don’t but I think I can, maybe barely. Also they are different; endpoint.ex is source, webpack.config.js config. You really don’t need ot rewrite endpoint.ex, but sometimes you do want to rewrite webpack.config.js. For example I have a simple static site that uses a few npm packages and tailwindcss. I wanted to write webpack.config.js from scratch. That was a major struggle.

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31586 112
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

We're in Beta

About us Mission Statement