From 9d2e0c5379cb695e5c8a5d951a0a8810dcd4e7b2 Mon Sep 17 00:00:00 2001 From: Adam Piontek Date: Tue, 6 Apr 2021 11:22:05 -0400 Subject: [PATCH] fixing purgecss issue with chroma styles --- .gitignore | 4 +--- README.md | 5 +++-- assets/webpack.config.js | 4 +++- config/config.exs | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index e527154..a03f4a6 100644 --- a/.gitignore +++ b/.gitignore @@ -39,10 +39,8 @@ npm-debug.log # for vscode elixir_ls extension files /.elixir_ls -# Ignore the pygments venv directory -/priv/pygments/ # Ignore chroma bin directory -/priv/chroma/ +/priv/go/ # dev TODO.md diff --git a/README.md b/README.md index 725b73e..bdd94ae 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,10 @@ cd /opt/home73k git pull mix deps.get --only prod MIX_ENV=prod mix compile -# update Pygments in venv -priv/pygments/bin/pip3 install -U Pygments +# update chroma in priv gopath +GOPATH=$(pwd)/priv/go go get -u github.com/alecthomas/chroma/cmd/chroma # rebuild static assets: +rm -rf priv/static/* npm run deploy --prefix ./assets MIX_ENV=prod mix phx.digest MIX_ENV=prod mix release --overwrite diff --git a/assets/webpack.config.js b/assets/webpack.config.js index 64b0643..22bd5b5 100644 --- a/assets/webpack.config.js +++ b/assets/webpack.config.js @@ -93,7 +93,9 @@ module.exports = (env, options) => { "../**/live/**/*.ex", "./js/**/*.js", ]), - safelist: [/phx/, /topbar/, /chroma/], + safelist: { + greedy: [/phx/, /topbar/, /chroma/], + }, }), ] ), diff --git a/config/config.exs b/config/config.exs index b6d32cc..cd43723 100644 --- a/config/config.exs +++ b/config/config.exs @@ -14,7 +14,7 @@ config :elixir, :time_zone_database, Tzdata.TimeZoneDatabase config :home73k, :app_global_vars, time_zone: "America/New_York", blog_content: "priv/content", - chroma_bin: "priv/chroma/chroma" + chroma_bin: "priv/go/bin/chroma" # Configures the endpoint config :home73k, Home73kWeb.Endpoint,