Skip to content

Bug: deleteOriginalAssets: true removes the .js.LICENSE.txt files #389

@mman

Description

@mman

Bug report

We are using CompressionPlugin as the last step of our webpack config. When specifying deleteOriginalAssets: true it does remove original .js file when .js.gz is produced, but it also accidentally deletes accompanying .js.LICENSE.txt

Actual Behavior

With deleteOriginalAssets: false:

-rw-r--r--  1 mman  staff  1423307 May 21 11:42 60.96569f9e.js
-rw-r--r--  1 mman  staff     2881 May 21 11:42 60.96569f9e.js.LICENSE.txt
-rw-r--r--  1 mman  staff   421274 May 21 11:42 60.96569f9e.js.gz
-rw-r--r--  1 mman  staff   160371 May 21 11:42 main.c742e74d.js
-rw-r--r--  1 mman  staff     1818 May 21 11:42 runtime-main.17566f78.js

With deleteOriginalAssets: true:

-rw-r--r--  1 mman  staff   421274 May 21 11:42 60.96569f9e.js.gz
-rw-r--r--  1 mman  staff   160371 May 21 11:42 main.c742e74d.js
-rw-r--r--  1 mman  staff     1818 May 21 11:42 runtime-main.17566f78.js

Expected Behavior

.js.LICENSE.txt should remain in place.

How Do We Reproduce?

This bug is affecting the following project where I summarised the issue as victronenergy/venus-html5-app#370.

Main webpack config is located here: https://github.com/victronenergy/venus-html5-app/blob/master/config/webpack.config.js

Please paste the results of npx webpack-cli info here, and mention other relevant information

€ npx webpack-cli info

  System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M2
    Memory: 81.77 MB / 16.00 GB
  Binaries:
    Node: 20.12.0 - /opt/homebrew/opt/node@20/bin/node
    npm: 10.5.0 - /opt/homebrew/opt/node@20/bin/npm
  Browsers:
    Chrome: 125.0.6422.60
    Safari: 17.5
  Packages:
    babel-loader: ^9.1.0 => 9.1.2 
    case-sensitive-paths-webpack-plugin: 2.3.0 => 2.3.0 
    compression-webpack-plugin: ^11.0.0 => 11.0.0 
    css-loader: ^6.7.3 => 6.7.3 
    css-minimizer-webpack-plugin: ^4.2.2 => 4.2.2 
    eslint-webpack-plugin: ^3.2.0 => 3.2.0 
    file-loader: ^6.2.0 => 6.2.0 
    html-webpack-plugin: ^4.5.2 => 4.5.2 
    pnp-webpack-plugin: ^1.6.4 => 1.7.0 
    postcss-loader: ^7.0.2 => 7.1.0 
    react-svg-loader: ^3.0.3 => 3.0.3 
    resolve-url-loader: ^5.0.0 => 5.0.0 
    sass-loader: ^10.0.5 => 10.4.1 
    style-loader: ^3.3.1 => 3.3.2 
    terser-webpack-plugin: ^4.2.3 => 4.2.3 
    url-loader: 4.1.1 => 4.1.1 
    webpack: ^5.75.0 => 5.76.2 
    webpack-cli: ^5.0.1 => 5.0.1 
    webpack-dev-middleware: ^6.0.1 => 6.0.2 
    webpack-dev-server: ^4.11.1 => 4.13.1 
    webpack-manifest-plugin: ^5.0.0 => 5.0.0 
    workbox-webpack-plugin: ^6.5.4 => 6.5.4 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions