소스 검색

ignore css imports in examples

Steven Silvester 5 년 전
부모
커밋
29b180c8a1
2개의 변경된 파일9개의 추가작업 그리고 7개의 파일을 삭제
  1. 8 6
      buildutils/src/ensure-package.ts
  2. 1 1
      packages/services/examples/typescript-browser-with-output/src/index.ts

+ 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';