-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for synchronous compilation functions
See sass/sass#3056
- Loading branch information
Showing
11 changed files
with
350 additions
and
511 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2021 Google LLC. Use of this source code is governed by an | ||
// MIT-style license that can be found in the LICENSE file or at | ||
// https://opensource.org/licenses/MIT. | ||
|
||
import * as fs from 'fs'; | ||
import * as p from 'path'; | ||
|
||
/** The path to the embedded compiler executable. */ | ||
export const compilerPath = (() => { | ||
for (const path of ['../vendor', '../../../../lib/src/vendor']) { | ||
const executable = p.resolve( | ||
__dirname, | ||
path, | ||
`dart-sass-embedded/dart-sass-embedded${ | ||
process.platform === 'win32' ? '.bat' : '' | ||
}` | ||
); | ||
|
||
if (fs.existsSync(executable)) return executable; | ||
} | ||
|
||
throw new Error( | ||
"Embedded Dart Sass couldn't find the embedded compiler executable." | ||
); | ||
})(); |
Oops, something went wrong.