Skip to content

Commit

Permalink
feat: handle default and project level resolve namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
idoros committed Jun 2, 2024
1 parent 9bedce9 commit dfc77e4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ connection.onInitialize(async (params) => {
fileSystem: wrappedFs,
requireModule: require,
cssParser: safeParse,
resolveNamespace(namespace, origin, source) {
try {
if (config.resolveNamespace) {
return config.resolveNamespace(namespace, origin, source);
}
} catch (e: unknown) {
// can be used to log project level errors
// console.warn('resolveNamespace failed', e);
}
// fallback to initial namespace
return namespace;
},
})
);

Expand Down

0 comments on commit dfc77e4

Please sign in to comment.