samrith-s / parcel-plugin-structurize

A plugin to customize the output (dist) directory structure during production.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

brotli (.br) and gzip (.gz) files are getting deleted

IsaacHub opened this issue · comments

I use parcel-plugin-compress to produce compressed files scripts.js to scripts.js.br and scripts.js.gz, it works well, but I wanted them to be structured like following:

dist/
   js/
     scripts.js
     scripts.js.br
     scripts.js.gz

While I build, those two compressed files are missing, If I remove this plugin and rebuild then I got those files back but I don't want a flat directory structure.

My package.json config:

"parcel-plugin-structurize": {
    "scripts": {
      "match": "*.{js,js.map,js.br,js.gz}",
      "folder": "js"
    },
    "styles": {
      "match": "*.{css,css.map,css.br,css.gz}",
      "folder": "css"
    }
  }

I just realized this plugin is not deleting but instead those .js and .css files are moved into another directories, and this structurize plugin couldn't find those, and .br and .gz are not created at all.

I fixed it by modifying compress source code.
ralscha/parcel-plugin-compress#10 (comment)