Просмотр исходного кода

Avoid contenthash in development (#7423)

GitOrigin-RevId: 5a52a1af1f6add4dea135639f0ec5a4577dba124
Alf Eaton 4 лет назад
Родитель
Сommit
9e6b1fbb67
1 измененных файлов с 25 добавлено и 0 удалено
  1. 25 0
      services/web/webpack.config.dev.js

+ 25 - 0
services/web/webpack.config.dev.js

@@ -10,6 +10,31 @@ module.exports = merge(base, {
   // Enable accurate source maps for dev
   devtool: 'source-map',
 
+  // Load entrypoints without contenthash in filename
+  output: {
+    filename: 'js/[name].js',
+  },
+
+  // Load assets without contenthash in filename
+  module: {
+    rules: [
+      {
+        test: /\.(woff|woff2)$/,
+        type: 'asset/resource',
+        generator: {
+          filename: 'fonts/[name][ext]',
+        },
+      },
+      {
+        test: /\.(svg|gif|png|jpg|pdf)$/,
+        type: 'asset/resource',
+        generator: {
+          filename: 'images/[name][ext]',
+        },
+      },
+    ],
+  },
+
   plugins: [
     // Extract CSS to a separate file (rather than inlining to a <style> tag)
     new MiniCssExtractPlugin({