webpack正在生成大量编号的文件

moiiocjp  于 2023-03-23  发布在  Webpack
关注(0)|答案(1)|浏览(168)

给定一个项目,webpack似乎会吐出一堆编号的文件。
以下是webpack输出:

Hash: a3eb428f28df3970678b
Version: webpack 2.4.1
Time: 5152ms
    Asset       Size         Chunks                    Chunk Names
    28.js    1.31 kB             28  [emitted]         
     0.js     318 kB              0  [emitted]  [big]  
     2.js    4.64 kB              2  [emitted]         
     3.js    2.61 kB              3  [emitted]         
     4.js    1.55 kB              4  [emitted]         
     5.js    4.09 kB              5  [emitted]         
     6.js    5.31 kB              6  [emitted]         
     7.js     316 kB              7  [emitted]  [big]  
     8.js    17.7 kB              8  [emitted]         
     9.js    1.41 kB              9  [emitted]         
    10.js     309 kB             10  [emitted]  [big]  
    11.js     267 kB             11  [emitted]  [big]  
    12.js     278 kB             12  [emitted]  [big]  
    13.js     392 kB             13  [emitted]  [big]  
    14.js     274 kB             14  [emitted]  [big]  
    15.js      14 kB             15  [emitted]         
    16.js     301 kB             16  [emitted]  [big]  
    17.js     348 kB             17  [emitted]  [big]  
    18.js     806 kB             18  [emitted]  [big]  
    19.js    3.45 kB             19  [emitted]         
    20.js     268 kB             20  [emitted]  [big]  
    21.js    34.2 kB             21  [emitted]         
    22.js    3.29 kB             22  [emitted]         
    23.js     1.8 kB             23  [emitted]         
    24.js    20.5 kB             24  [emitted]         
    25.js     317 kB             25  [emitted]  [big]  
    26.js     826 kB         26, 18  [emitted]  [big]  
    27.js     323 kB             27  [emitted]  [big]  
     1.js     306 kB              1  [emitted]  [big]  
    29.js     391 kB             29  [emitted]  [big]  
    30.js     354 kB             30  [emitted]  [big]  
    31.js     301 kB             31  [emitted]  [big]  
    32.js    1.37 kB             32  [emitted]         
    33.js    4.81 kB             33  [emitted]         
    34.js     322 kB          34, 0  [emitted]  [big]  
    35.js     283 kB         35, 11  [emitted]  [big]  
    36.js     335 kB             36  [emitted]  [big]  
    37.js     267 kB             37  [emitted]  [big]  
    38.js    11.8 kB             38  [emitted]         
    39.js    2.51 kB             39  [emitted]         
    40.js    3.07 kB             40  [emitted]         
    41.js    2.56 kB             41  [emitted]         
    42.js     1.7 kB             42  [emitted]         
    43.js    2.16 kB             43  [emitted]         
    44.js     870 kB  44, 8, 18, 21  [emitted]  [big]  
    45.js     318 kB             45  [emitted]  [big]  
    46.js     312 kB             46  [emitted]  [big]  
    47.js    3.99 kB             47  [emitted]         
    48.js    11.1 kB             48  [emitted]         
    49.js  980 bytes             49  [emitted]         
    50.js     1.5 kB             50  [emitted]         
    51.js    3.37 kB             51  [emitted]         
    52.js    1.99 kB             52  [emitted]         
    53.js     1.2 kB             53  [emitted]         
    54.js    1.51 kB             54  [emitted]         
bnymim.js    96.7 kB             55  [emitted]         bnymim
   [4] ./modules/siteNav.coffee 3.77 kB {5} [built]
   [5] ./modules/toggleSearch.coffee 1.24 kB {4} [built]
   [6] ./modules/predictiveSearch.coffee 4.99 kB {6} [built]
   [7] ./modules/external-link.coffee 1.92 kB {7} [built]
   [8] ./modules/tabs.coffee 9.07 kB {8} {44} [built]
   [9] ./modules/clickable-promo.coffee 1.1 kB {9} [built]
  [10] ./modules/consent-modal.coffee 3.08 kB {10} [built]
  [11] ./modules/equal-heights.coffee 2.33 kB {11} {35} [built]
  [12] ./modules/data-points.coffee 5.27 kB {12} [built]
  [13] ./modules/date-picker.coffee 5.51 kB {13} [built]
  [14] ./modules/article-share.coffee 2.25 kB {15} [built]
  [34] ./bnymim-requires.coffee 24.5 kB {55} [built]
  [35] ./bnymim.coffee 886 bytes {55} [built]
  [43] ./modules/splashscreen.coffee 4.59 kB {34} [built]
  [46] multi bnymim.coffee bnymim-requires.coffee 40 bytes {55} [built]
    + 71 hidden modules

WARNING in ../vendor/moment.js
Module not found: Error: Can't resolve './locale' in 'C:\Projects\BNYMellon\bnyim-develop\FED\vendor'
 @ ../vendor/moment.js 6:2798-2820
 @ ./modules/date-picker.coffee
 @ ./bnymim-requires.coffee
 @ multi bnymim.coffee bnymim-requires.coffee

我不知道为什么要这样做。我想理想情况下我得到一个“bnymim-bundle.js”注意webpack.config.js中指定了两个入口文件

rxztt3cl

rxztt3cl1#

我今天遇到了这种情况,我想这是因为我先在nodejs 16中使用npm install,然后升级到版本18,并且没有清除npm的缓存。
要清除npm的缓存,请键入npm cache clear --force。同时删除整个node_modules文件夹,并使用npm install重新安装所有依赖项。

相关问题