Skip to content

Commit

Permalink
Migrating webpack to esbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanIvanoff committed Oct 31, 2023
1 parent fc1cfdc commit 9f3f243
Show file tree
Hide file tree
Showing 1,004 changed files with 3,745 additions and 50,167 deletions.
24 changes: 11 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ENV PATH=/root/.cargo/bin:$PATH

# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
mix local.rebar --force

# set build ENV
ENV MIX_ENV="prod"
Expand All @@ -50,14 +50,14 @@ RUN mkdir config
# to ensure any relevant config change will trigger the dependencies
# to be re-compiled.
COPY config/config.exs \
config/ueberauth_config.exs \
config/ex_admin_config.exs \
config/notifications_config.exs \
config/scheduler_config.exs \
config/scrapers_config.exs \
config/stripe_config.exs \
config/${MIX_ENV}.exs \
config/
config/ueberauth_config.exs \
config/ex_admin_config.exs \
config/notifications_config.exs \
config/scheduler_config.exs \
config/scrapers_config.exs \
config/stripe_config.exs \
config/${MIX_ENV}.exs \
config/

RUN mix deps.compile

Expand All @@ -71,9 +71,7 @@ COPY assets assets
# RUN mix format --check-formatted

# compile assets
RUN cd assets && npm install
RUN cd assets && npm run build:prod
RUN mix phx.digest
RUN mix assets.deploy

# Compile the release
RUN mix compile
Expand All @@ -89,7 +87,7 @@ RUN mix release
FROM ${RUNNER_IMAGE}

RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales imagemagick git \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
&& apt-get clean && rm -f /var/lib/apt/lists/*_*

# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
Expand Down
5 changes: 0 additions & 5 deletions assets/.babelrc

This file was deleted.

7 changes: 3 additions & 4 deletions assets/css/app.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/* This file is for your main application css. */
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";

@tailwind base;
@tailwind components;
@tailwind utilities;

.show {
@apply px-6 py-4 text-lg text-gray-700 border-b
Expand Down
23 changes: 4 additions & 19 deletions assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,6 @@
// Brunch automatically concatenates all files in your
// watched paths. Those paths can be configured at
// config.paths.watched in "brunch-config.js".
//
// However, those files will only be executed if
// explicitly imported. The only exception are files
// in vendor, which are never wrapped in imports and
// therefore are always executed.

// Import dependencies
//
// If you no longer want to use a dependency, remember
// to also remove its path from "config.paths.watched".
// js
import "phoenix_html"
import "./socket.js"

// Import local files
//
// Local files can be imported directly using relative
// paths "./socket" or full ones "web/static/js/socket".

import css from '../css/app.css';
// css
import '../css/app.css';
10 changes: 5 additions & 5 deletions assets/js/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ let socket = new Socket("/socket", {params: {token: window.userToken}})
socket.connect()

// Now that you are connected, you can join channels with a topic:
let channel = socket.channel("topic:subtopic", {})
channel.join()
.receive("ok", resp => { console.log("Joined successfully", resp) })
.receive("error", resp => { console.log("Unable to join", resp) })
// let channel = socket.channel("topic:subtopic", {})
// channel.join()
// .receive("ok", resp => { console.log("Joined successfully", resp) })
// .receive("error", resp => { console.log("Unable to join", resp) })

export default socket
// export default socket
Loading

0 comments on commit 9f3f243

Please sign in to comment.