Quellcode durchsuchen

ignore css imports in examples

Steven Silvester vor 5 Jahren
Ursprung
Commit
29b180c8a1

+ 8 - 6
buildutils/src/ensure-package.ts

@@ -83,12 +83,14 @@ export async function ensurePackage(
     imports = imports.concat(getImports(sourceFile));
   });
 
-  // Make sure we are not importing CSS.
-  imports.forEach(importStr => {
-    if (importStr.indexOf('.css') !== -1) {
-      messages.push('CSS imports are not allowed source files');
-    }
-  });
+  // Make sure we are not importing CSS in a core package.
+  if (data.name.indexOf('example') === -1) {
+    imports.forEach(importStr => {
+      if (importStr.indexOf('.css') !== -1) {
+        messages.push('CSS imports are not allowed source files');
+      }
+    });
+  }
 
   let names: string[] = Array.from(new Set(imports)).sort();
   names = names.map(function(name) {

+ 1 - 1
packages/services/examples/typescript-browser-with-output/src/index.ts

@@ -9,7 +9,7 @@ import { PageConfig, URLExt } from '@jupyterlab/coreutils';
 __webpack_public_path__ = URLExt.join(PageConfig.getBaseUrl(), 'example/');
 
 // This has to be done after webpack public path is set to load the
-// font file.
+// fonts.
 import '../style/index.css';
 
 import { OutputArea, OutputAreaModel } from '@jupyterlab/outputarea';