Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions tools/extract-tokens/extract-tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ function extractTokens(themePath: string): Token[] {

const startMarker = '/*! extract tokens start */';
const endMarker = '/*! extract tokens end */';
const absoluteThemePath = join(process.cwd(), themePath);
const srcPath = join(process.cwd(), 'src');
const root = process.cwd();
const absoluteThemePath = join(root, themePath);
const srcPath = join(root, 'src');
const {prepend, append} = getTokenExtractionCode(
srcPath,
themePath,
Expand All @@ -93,6 +94,16 @@ function extractTokens(themePath: string): Token[] {
compileString(toCompile, {
loadPaths: [srcPath],
url: pathToFileURL(absoluteThemePath),
importers: [
{
findFileUrl: (url: string) => {
const angularPrefix = '@angular/';
return url.startsWith(angularPrefix)
? pathToFileURL(join(srcPath, url.substring(angularPrefix.length)))
: null;
},
},
],
sourceMap: false,
logger: {
debug: message => {
Expand Down
Loading