Support pure JS sass executable#344
Conversation
sass --embedded in pure JS modesass executable
There was a problem hiding this comment.
The reason to split this into a different module is that compiler-path contains IIFE that may throw on load, but in tool scripts, we need to know the compiler-module name to setup dev environment without throwing. Therefore it's moved to a separate file.
|
Because this PR assumes that the dartvm and dart2js sass-compiler will behave exactly same from an external viewpoint, this PR only run test the against dartvm in the CI. The dart2js based CI test is configured in the dart-sass repo itself. Therefore, this PR has no dependency on dart-sass side of PR, and can be merged independently. - I would like to have this PR merged first, so that I don't have to keep resolving merge conflict every time the version number is bumped. Of course, if we merge this PR first before merging the dart-sass PR, the API mode won't work. However, at least it allows users to run @nex3 With the above said, it would be nice if you can take a look and merge this, even if we don't merge dart-sass PR right away. |
nex3
left a comment
There was a problem hiding this comment.
I'm on board to land this first.
However, at least it allows users to run npm exe sass-embedded consistently on all platforms without native dart support.
I don't completely understand this. It looks like this PR only affects local development. How will it affect what users can do at all?
Today if you run |
|
Code review feedbacks have been applied. |
Wouldn't that require us to start shipping a "binary" package that adds a dependency on |
I added sass directly as an optional dependency. We can create a “binary” package that simply depends on “sass”, but due to how npm select optional dependencies, technically we need two separate packages to cover all systems:
Let me know if that if preferred over having “sass” itself as direct optional dependency. |
|
Since |
There was a problem hiding this comment.
Since these packages behave unusually relative to the binary packages, they should probably have slightly more descriptive READMEs and npm descriptions.
There was a problem hiding this comment.
Updated. Feel free to further amend the language if you have any other preference.
|
Note, here is the PR to update the dart-sass side of CI pipeline for this: sass/dart-sass#2609 |
sass/dart-sass#2413
This PR changes how compiler is setup for local development. Instead of symlink the compiler into a special vendor directory:
build/dart-sass/build->node_modules/sass-embedded-${platform}-${arch}/dart-sass.build/dart-sass/build/npm->node_modules/sass.Only one kind of compiler will be installed by
init.ts, that the other kind will be removed if exists.In the
compiler-path.ts, loading the compiler is attempted in the order of: