Skip to content

Instantly share code, notes, and snippets.

@schallis
Created April 19, 2023 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schallis/b04eaa44966abb8ae25a4f14f6c48a8e to your computer and use it in GitHub Desktop.
Save schallis/b04eaa44966abb8ae25a4f14f6c48a8e to your computer and use it in GitHub Desktop.

Dart-Sass running options on M1 Mac

This repo demonstrates usage of dart-sass using both a Docker container to run the linux binary (for cross compatibility) and also natively using the arm64 binary on an M1 mac

Setup (Using Docker)

Following https://mybyways.com/blog/running-sass-in-a-container

Download dart-sass-1.62.0-linux-x64.tar

brew install docker --cask  # UI install

Now open Docker.app and perform setup. Then using the Dockerfile in this repo run:

docker build -t sass ./
docker run --rm -it --init -v /[dir-to-scss-files]:/css sass

Setup (Native arm64 on M1 Mac)

Download https://github.com/sass/dart-sass/releases/download/1.62.0/dart-sass-1.62.0-macos-arm64.tar.gz

cd native/
tar -xvzf dart-sass-1.62.0-macos-arm64.tar.gz
dart-sass/sass ../css
FROM google/dart
ADD ./dart-sass-1.62.0-linux-x64.tar /opt/
WORKDIR /opt/dart-sass
ENTRYPOINT ["/opt/dart-sass/sass", "--watch", "/css"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment