File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,10 @@ import * as worker from '@bazel/worker';
2
2
import * as fs from 'fs' ;
3
3
import * as path from 'path' ;
4
4
import yargs from 'yargs' ;
5
+ import { OutputStyle , compile } from 'sass' ;
5
6
6
7
import { createLocalAngularPackageImporter } from './local-sass-importer' ;
7
8
8
- // TODO: Switch to normal import when https://github.com/sass/dart-sass/issues/1714 is fixed.
9
- // Also re-add the `as XX` type narrowing below.
10
- const sass = require ( 'sass' ) as any ;
11
-
12
9
const workerArgs = process . argv . slice ( 2 ) ;
13
10
14
11
// Note: This path is relative to the current working directory as build actions
@@ -63,8 +60,8 @@ async function processBuildAction(args: string[]) {
63
60
. option ( 'style' , { type : 'string' } )
64
61
. parseAsync ( ) ;
65
62
66
- const result = sass . compile ( inputExecpath , {
67
- style : style , // TODO: Re-add: as sass. OutputStyle,
63
+ const result = compile ( inputExecpath , {
64
+ style : style as OutputStyle ,
68
65
sourceMap,
69
66
sourceMapIncludeSources : embedSources ,
70
67
loadPaths : loadPath ,
Original file line number Diff line number Diff line change 1
1
import { pathToFileURL } from 'url' ;
2
2
import { join } from 'path' ;
3
-
4
- // TODO: Add explicit type for `Sass.FileImporter` once
5
- // https://github.com/sass/dart-sass/issues/1714 is fixed.
3
+ import { FileImporter } from 'sass' ;
6
4
7
5
/** Prefix indicating Angular-owned Sass imports. */
8
6
const angularPrefix = '@angular/' ;
@@ -11,7 +9,7 @@ const angularPrefix = '@angular/';
11
9
* Creates a Sass `FileImporter` that resolves `@angular/<..>` packages to the
12
10
* specified local packages directory.
13
11
*/
14
- export function createLocalAngularPackageImporter ( packageDirAbsPath : string ) {
12
+ export function createLocalAngularPackageImporter ( packageDirAbsPath : string ) : FileImporter {
15
13
return {
16
14
findFileUrl : ( url : string ) => {
17
15
if ( url . startsWith ( angularPrefix ) ) {
You can’t perform that action at this time.
0 commit comments