webpack中的output.chunkFilename

前端之家收集整理的这篇文章主要介绍了webpack中的output.chunkFilename前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<table class="javascript"><tr class="li1">
<td class="ln"><pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

gulp 发展到近期比较流行的webpack   webpack中,比较重要的点有entry,loader,plugin和output。   output中比较常见的有filename path publicPath,这几个基本上之前做构建的时候都用过   有个比较常见但是几乎没怎么用过的是chunkFilename   chunkFilename   chunkFilename常用的使用场景就是,在异步加载的时候,确认资源的名称,如   require. require    require   其中第三个参数test则指明了chunkFilename中的name值 在做构建的过程中,会发现在output的路径中出现test..文件,这个文件就是异步加载所需要的文件   在构建过程中,如果该entry已经在其他地方引入了该t.,那么磁盘上就不会生成test..了,因为webpack已经知晓该文件已经被打入到bundle中     reactrouter作为比价常用的库,所使用的场景非常适合使用require.加载。 reactrouter提供getComponent方法来实现异步加载     component require   childRoutes     path logout'       getComponent nextState cb         require. require           cb requirelogout'                       path require                                                  

猜你在找的程序笔记相关文章