Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace node+npm+webpack by esbuild #4377

Merged
merged 6 commits into from Jul 19, 2021
Merged

Replace node+npm+webpack by esbuild #4377

merged 6 commits into from Jul 19, 2021

Conversation

josevalim
Copy link
Member

No description provided.

@r-guimaraes
Copy link

neat

guides/directory_structure.md Outdated Show resolved Hide resolved
josevalim and others added 3 commits July 19, 2021 01:19
@@ -116,10 +116,8 @@ Finally, there is a `lib/hello_web/gettext.ex` file which provides international

## 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.

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.

Check your digested files at "priv/static".
```

*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.

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?

Co-authored-by: Chris McCord <chris@chrismccord.com>
@josevalim josevalim merged commit d467c88 into master Jul 19, 2021
@josevalim
Copy link
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

Бу

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.

None yet

8 participants