-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a Sass executable wrapper that forwards to the correct exe (#313)
This allows users to run `npx sass` when they've just installed `sass-embedded` and directly run the Dart VM. Due to npm/cmd-shim#152, there's no way to make this work on Windows CMD/Powershell without substantially curtailing the performance on other operating systems.
- Loading branch information
Showing
4 changed files
with
28 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env node | ||
|
||
import * as child_process from 'child_process'; | ||
import {compilerCommand} from '../lib/src/compiler-path'; | ||
|
||
// TODO npm/cmd-shim#152 and yarnpkg/berry#6422 - If and when the package | ||
// managers support it, we should make this a proper shell script rather than a | ||
// JS wrapper. | ||
|
||
try { | ||
child_process.execFileSync( | ||
compilerCommand[0], | ||
[...compilerCommand.slice(1), ...process.argv.slice(2)], | ||
{ | ||
stdio: 'inherit', | ||
windowsHide: true, | ||
} | ||
); | ||
} catch (error) { | ||
if (error.code) { | ||
throw error; | ||
} else { | ||
process.exitCode = error.status; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"exclude": [ | ||
"jest.config.js", | ||
"lib/src/vendor/dart-sass/**", | ||
"**/*.test.ts" | ||
] | ||
|
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 |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
}, | ||
"include": [ | ||
"*.ts", | ||
"bin/*.ts", | ||
"lib/**/*.ts", | ||
"tool/**/*.ts", | ||
"test/**/*.ts" | ||
|