Skip to content

Commit

Permalink
Remove old package.json and .babelrc files (Phoenix Upgrade to 1.6) πŸŽ‰β€¦
Browse files Browse the repository at this point in the history
… see: #55 (comment)
  • Loading branch information
nelsonic committed Oct 15, 2021
1 parent a428e4b commit 1505878
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 94 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: MIX_ENV=prod mix ecto.migrate && mix phx.server
web: MIX_ENV=prod mix ecto.migrate && mix assets.deploy && mix phx.server
5 changes: 0 additions & 5 deletions assets/.babelrc

This file was deleted.

27 changes: 0 additions & 27 deletions assets/package.json

This file was deleted.

51 changes: 0 additions & 51 deletions assets/webpack.config.js

This file was deleted.

8 changes: 7 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@ config :phoenix, :json_library, Jason
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"

config :esbuild, :version, "0.13.4"
config :esbuild,
version: "0.13.4",
default: [
args: ~w(js/app.js --bundle --target=es2016 --outdir=../priv/static/assets),
cd: Path.expand("../assets", __DIR__),
env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}
]
9 changes: 2 additions & 7 deletions config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@ config :chat, ChatWeb.Endpoint,
code_reloader: true,
check_origin: false,
watchers: [
node: [
"node_modules/webpack/bin/webpack.js",
"--mode",
"development",
"--watch-stdin",
cd: Path.expand("../assets", __DIR__)
]
# Start the esbuild watcher by calling Esbuild.install_and_run(:default, args)
esbuild: {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]}
]

# ## SSL Support
Expand Down
2 changes: 1 addition & 1 deletion lib/chat_web/endpoint.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ defmodule ChatWeb.Endpoint do
at: "/",
from: :chat,
gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)
only: ~w(assets fonts images favicon.ico robots.txt)

# Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint.
Expand Down
3 changes: 2 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ defmodule Chat.Mixfile do
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test"],
cover: ["coveralls.json"],
"cover.html": ["coveralls.html"]
"cover.html": ["coveralls.html"],
"assets.deploy": ["esbuild default --minify", "phx.digest"]
]
end
end

0 comments on commit 1505878

Please sign in to comment.