mrengy / vanguard-history

History site for the Santa Clara Vanguard
GNU General Public License v3.0
0 stars 0 forks source link

Add a post-merge hook to build scss instead #88

Closed shekharkhedekar closed 1 year ago

shekharkhedekar commented 1 year ago

Suggested alternative to the build_sass workflow.

Basically, we add style.css to .gitignore, and then whenever we pull, we rebuild the css. I'm assuming that:

  1. Developers will have a sass . --watch command running to make sure their local CSS are built (and not committed)
  2. When you deploy, you'll git pull on the deploy machine and the hook will run then to build the css. We can try it out on staging, I suppose
mrengy commented 1 year ago

Okay, I merged this and ran the command git config core.hooksPath .github/hooks on my local, dev, stage, and production (just so I don't forget to do it there later). Then when I pulled main to my local environment, the SASS compiled 🎉.

However, I noticed that the SASS compiling automation output in Terminal showed:

up to date, audited 1 package in 176ms

found 0 vulnerabilities

vanguard-history@1.0.0 sass sass . --style=compressed --no-source-map

The --no-source-map option means that the browser inspector shows all styles as coming from style.css rather than the SCSS files from which they originate. See documentation. I think we want source maps. Let me see if I can configure this correctly to include source maps.

mrengy commented 1 year ago

Resolved with https://github.com/mrengy/vanguard-history/commit/8b9484a1cca71cec867582f0bd30b91f73183d9a , I think ;)

mrengy commented 1 year ago

I had to install NVM and Node 16.19.0 (Node 19 was throwing an error) on the server. It was a bit involved but seems to work now.