ソースを参照

disabled pkg dupe check in watch mode to reduce noise in console output

also removed redundant `chunkModules: true` from webpack config
telamonian 5 年 前
コミット
93709e111f
2 ファイル変更17 行追加7 行削除
  1. 15 0
      buildutils/src/webpack-plugins.ts
  2. 2 7
      dev_mode/webpack.config.js

+ 15 - 0
buildutils/src/webpack-plugins.ts

@@ -5,6 +5,7 @@
 
 import * as webpack from 'webpack';
 import * as fs from 'fs-extra';
+var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
 
 export namespace WPPlugin {
   /**
@@ -171,4 +172,18 @@ export namespace WPPlugin {
 
     ignored: (path: string) => boolean;
   }
+
+  export class NowatchDuplicatePackageCheckerPlugin extends DuplicatePackageCheckerPlugin {
+    apply(compiler: any) {
+      const options = this.options;
+
+      compiler.hooks.run.tap(
+        'NowatchDuplicatePackageCheckerPlugin',
+        (compiler: any) => {
+          const p = new DuplicatePackageCheckerPlugin(options);
+          p.apply(compiler);
+        }
+      );
+    }
+  }
 }

+ 2 - 7
dev_mode/webpack.config.js

@@ -8,7 +8,6 @@ var fs = require('fs-extra');
 var Handlebars = require('handlebars');
 var HtmlWebpackPlugin = require('html-webpack-plugin');
 var webpack = require('webpack');
-var DuplicatePackageCheckerPlugin = require('duplicate-package-checker-webpack-plugin');
 var BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
   .BundleAnalyzerPlugin;
 
@@ -122,7 +121,7 @@ function ignored(path) {
 }
 
 const plugins = [
-  new DuplicatePackageCheckerPlugin({
+  new WPPlugin.NowatchDuplicatePackageCheckerPlugin({
     verbose: true,
     exclude(instance) {
       // ignore known duplicates
@@ -137,7 +136,6 @@ const plugins = [
     title: jlab.name || 'JupyterLab'
   }),
   new webpack.HashedModuleIdsPlugin(),
-
   // custom plugin for ignoring files during a `--watch` build
   new WPPlugin.FilterWatchIgnorePlugin(ignored),
   // custom plugin that copies the assets to the static directory
@@ -223,9 +221,6 @@ module.exports = [
     bail: true,
     devtool: 'inline-source-map',
     externals: ['node-fetch', 'ws'],
-    plugins,
-    stats: {
-      chunkModules: true
-    }
+    plugins
   }
 ].concat(extraConfig);