Skip to content

Rewrite SCSS compilation in Bash #31608

Description

@kdmccormick

Background

Part of:

Subtasks

  • Create a sh (not bash) script scripts/assets/compile-sass.sh, re-implementing the functionality of pavelib/assets.py:_compile_sass.
  • Replace the implemention of pavelib/assets.py:_compile_sass with a simple call to the new shell script.

Notes

This is blocked by upgrading to node-sass or dart-sass. That's because, with libsass-python (our current compliation mechanism), there are two ways to compile Sass, and neither are satisfactory:

  • The Python API (sass.compile(..)), which we currently use, cannot not be elegantly called from a shell script. It'd have to be implemented with brittle command along the lines of:
    python -c "import sass; sass.compile(dirname=('$sass_src', '$css_dest'), include_paths=$include_paths, ... )"
    where $include_paths would have to be stitched together, in shell. That all sounds like a step backwards rather than in improvement.
  • The command line interface that comes with the library, sassc does not accept directories as parameters, only individual files. We'd need to implement the logic to compile every file in a directory ourselves.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions