Skip to content

Replace node+npm+webpack by esbuild#4377

Merged
josevalim merged 6 commits into
masterfrom
jv-webpack-esbuild
Jul 19, 2021
Merged

Replace node+npm+webpack by esbuild#4377
josevalim merged 6 commits into
masterfrom
jv-webpack-esbuild

Conversation

@josevalim

Copy link
Copy Markdown
Member

No description provided.

@r-guimaraes

Copy link
Copy Markdown

neat

Comment thread guides/directory_structure.md Outdated
Comment thread guides/directory_structure.md Outdated
Comment thread installer/templates/phx_assets/app.js
josevalim and others added 3 commits July 19, 2021 01:19
Comment thread guides/directory_structure.md Outdated
## The assets directory

The `assets` directory contains everything related to front-end assets, such as JavaScript, CSS, static images and more. It is typically handled by the [npm] tool. Phoenix developers typically only need to run `npm install` inside the assets directory. Everything else is managed by Phoenix.
The `assets` directory contains source files related to front-end assets, such as JavaScript and CSS. Since Phoenix v1.6, we use the [`esbuild`](https://github.com/evanw/esbuild/) to compile assets, which is managed by the [`esbuild`](https://github.com/phoenixframework/esbuild) Elixir package. The integration with `esbuild` is backed into your app. The relevant config can be found in your `config/config.exs` file.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `assets` directory contains source files related to front-end assets, such as JavaScript and CSS. Since Phoenix v1.6, we use the [`esbuild`](https://github.com/evanw/esbuild/) to compile assets, which is managed by the [`esbuild`](https://github.com/phoenixframework/esbuild) Elixir package. The integration with `esbuild` is backed into your app. The relevant config can be found in your `config/config.exs` file.
The `assets` directory contains source files related to front-end assets, such as JavaScript and CSS. Since Phoenix v1.6, we use the [`esbuild`](https://github.com/evanw/esbuild/) to compile assets, which is managed by the [`esbuild`](https://github.com/phoenixframework/esbuild) Elixir package. The integration with `esbuild` is baked into your app. The relevant config can be found in your `config/config.exs` file.

Comment thread guides/directory_structure.md Outdated
Comment thread installer/templates/phx_assets/app.js Outdated
Comment thread installer/templates/phx_assets/app.js Outdated
Comment thread guides/deployment/deployment.md Outdated

*Note:* the `--prefix` flag on `npm` may not work on Windows. If so, replace the first command by `cd assets && npm run deploy && cd ..`.

And that is it! The first command builds the assets and the second generates digests as well as a cache manifest file so Phoenix can quickly serve assets in production.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it's just a simple command, make sense to change it too?

Comment thread guides/deployment/deployment.md Outdated
Co-authored-by: Chris McCord <chris@chrismccord.com>
@josevalim josevalim merged commit d467c88 into master Jul 19, 2021
@josevalim

Copy link
Copy Markdown
Member Author

💚 💙 💜 💛 ❤️

@josevalim josevalim deleted the jv-webpack-esbuild branch July 19, 2021 05:45
sthagen added a commit to sthagen/phoenixframework-phoenix that referenced this pull request Jul 19, 2021
@adamlaska

Copy link
Copy Markdown

Бу

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants