Skip to content

Commit

Permalink
Do not add dependency css for theme packages.
Browse files Browse the repository at this point in the history
The theme css bundler cannot handle dependency imports. Explicitly specifying the dependencies to ignore for built-in themes does not solve the problem when linking a local theme extension, as happens in the usage test with the “foo” extension.
  • Loading branch information
jasongrout committed Dec 1, 2020
1 parent e034c14 commit cddeaf9
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions buildutils/src/ensure-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,6 @@ const SKIP_CSS: Dict<string[]> = {
'@jupyterlab/cells',
'@jupyterlab/notebook'
],
'@jupyterlab/theme-dark-extension': [
'@jupyterlab/application',
'@jupyterlab/apputils'
],
'@jupyterlab/theme-light-extension': [
'@jupyterlab/application',
'@jupyterlab/apputils'
],
'@jupyterlab/ui-extension': ['@blueprintjs/icons']
};

Expand Down Expand Up @@ -488,16 +480,19 @@ export async function ensureIntegrity(): Promise<boolean> {
});
}

Object.keys(deps).forEach(depName => {
// Bail for skipped imports and known extra styles.
if (skip.indexOf(depName) !== -1 || depName in cssData) {
return;
}
const depData = graph.getNodeData(depName);
if (typeof depData.style === 'string') {
cssData[depName] = [depData.style];
}
});
// Add dependency css if package is not a theme package
if (!(data.jupyterlab && data.jupyterlab.themePath)) {
Object.keys(deps).forEach(depName => {
// Bail for skipped imports and known extra styles.
if (skip.indexOf(depName) !== -1 || depName in cssData) {
return;
}
const depData = graph.getNodeData(depName);
if (typeof depData.style === 'string') {
cssData[depName] = [depData.style];
}
});
}

// Get our CSS imports in dependency order.
cssImports[name] = [];
Expand Down

0 comments on commit cddeaf9

Please sign in to comment.