@scil/replace-chunks-name-webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

3.0.2 • Public • Published

perform replacing on webpack chunks filenames, useful to shorten filename when dev.

origin: webpack-replace-chunks-name-plugin which only replace the whole filename, not part. And it use api compilation.hooks.shouldGenerateChunkAssets.

安装

pnpm add @scil/replace-chunks-name-webpack-plugin -D
yarn add @scil/replace-chunks-name-webpack-plugin -D
npm install @scil/replace-chunks-name-webpack-plugin -D

options


      new ReplaceChunksNamePlugin({
          enable: !isProdMode,
          replaces: [
            {
              pattern: 'vendors-node_modules',
              replacement: '[m',
            },
            {
              pattern: /node_modules([-_])/g,
              replacement: '[m-$1',
            },
          ]
        }

input: chunk-vendors-node_modules_tinymce_tinymce-vue_lib_es2015_main_ts_index_js-node_modules_tinymce_ico-0fac6b.js

output
chunk-[m_tinymce_tinymce-vue_lib_es2015_main_ts_index_js-[m-_tinymce_ico-0fac6b.js

credit

Package Sidebar

Install

npm i @scil/replace-chunks-name-webpack-plugin

Weekly Downloads

1

Version

3.0.2

License

ISC

Unpacked Size

16.4 kB

Total Files

10

Last publish

Collaborators

  • scil