瀏覽代碼

Use the new recommended [contenthash] naming for webpack files.

Also, the default module ids in webpack 5 uses deterministic numbers in production mode, so we do not need the HashedModuleIdsPlugin anymore.
Jason Grout 4 年之前
父節點
當前提交
e313a55999
共有 2 個文件被更改,包括 3 次插入4 次删除
  1. 2 2
      builder/src/webpack.config.ext.ts
  2. 1 2
      dev_mode/webpack.config.js

+ 2 - 2
builder/src/webpack.config.ext.ts

@@ -182,7 +182,7 @@ module.exports = [
       [data.name]: publicpath
     },
     output: {
-      filename: '[name].[chunkhash].js',
+      filename: '[name].[contenthash].js',
       path: outputPath
     },
     module: {
@@ -195,7 +195,7 @@ module.exports = [
           type: 'var',
           name: ['_JUPYTERLAB', data.name]
         },
-        filename: 'remoteEntry.js',
+        filename: 'remoteEntry.[contenthash].js',
         exposes,
         shared
       })

+ 1 - 2
dev_mode/webpack.config.js

@@ -192,7 +192,6 @@ const plugins = [
     template: plib.join(__dirname, 'templates', 'template.html'),
     title: jlab.name || 'JupyterLab'
   }),
-  new webpack.ids.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,7 +222,7 @@ module.exports = [
     output: {
       path: plib.resolve(buildDir),
       publicPath: '{{page_config.fullStaticUrl}}/',
-      filename: '[name].[chunkhash].js'
+      filename: '[name].[contenthash].js'
     },
     optimization: {
       splitChunks: {