@@ -6,8 +6,8 @@ import * as fs from 'fs';
6
6
import * as p from 'path' ;
7
7
import { isErrnoException } from './utils' ;
8
8
9
- /** The path to the embedded compiler executable. */
10
- export const compilerPath = ( ( ) => {
9
+ /** The full command for the embedded compiler executable. */
10
+ export const compilerCommand = ( ( ) => {
11
11
// find for development
12
12
for ( const path of [ 'vendor' , '../../../lib/src/vendor' ] ) {
13
13
const executable = p . resolve (
@@ -18,15 +18,33 @@ export const compilerPath = (() => {
18
18
} `
19
19
) ;
20
20
21
- if ( fs . existsSync ( executable ) ) return executable ;
21
+ if ( fs . existsSync ( executable ) ) return [ executable ] ;
22
22
}
23
23
24
24
try {
25
- return require . resolve (
26
- `sass-embedded-${ process . platform } -${ process . arch } /` +
27
- 'dart-sass-embedded/dart-sass-embedded' +
28
- ( process . platform === 'win32' ? '.bat' : '' )
29
- ) ;
25
+ return [
26
+ require . resolve (
27
+ `sass-embedded-${ process . platform } -${ process . arch } /` +
28
+ 'dart-sass-embedded/src/dart' +
29
+ ( process . platform === 'win32' ? '.exe' : '' )
30
+ ) ,
31
+ require . resolve (
32
+ `sass-embedded-${ process . platform } -${ process . arch } /` +
33
+ 'dart-sass-embedded/src/dart-sass-embedded.snapshot'
34
+ ) ,
35
+ ] ;
36
+ } catch ( ignored ) {
37
+ // ignored
38
+ }
39
+
40
+ try {
41
+ return [
42
+ require . resolve (
43
+ `sass-embedded-${ process . platform } -${ process . arch } /` +
44
+ 'dart-sass-embedded/dart-sass-embedded' +
45
+ ( process . platform === 'win32' ? '.bat' : '' )
46
+ ) ,
47
+ ] ;
30
48
} catch ( e : unknown ) {
31
49
if ( ! ( isErrnoException ( e ) && e . code === 'MODULE_NOT_FOUND' ) ) {
32
50
throw e ;
0 commit comments