File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ Used to collect chunks server-side and get them as script tags or script element
193193| ` options.statsFile ` | Stats file path generated using ` @loadable/webpack-plugin ` . |
194194| ` options.stats ` | Stats generated using ` @loadable/webpack-plugin ` . |
195195| ` options.entrypoints ` | Webpack entrypoints to load (default to ` ["main"] ` ). |
196+ | ` options.outputPath ` | Optional output path (only for ` requireEntrypoint ` ). |
196197
197198You must specify either ` statsFile ` or ` stats ` to be able to use ` ChunkExtractor ` .
198199
Original file line number Diff line number Diff line change @@ -77,8 +77,9 @@ function joinTags(tags) {
7777}
7878
7979class ChunkExtractor {
80- constructor ( { statsFile, stats, entrypoints = [ 'main' ] } = [ ] ) {
80+ constructor ( { statsFile, stats, entrypoints = [ 'main' ] , outputPath } = [ ] ) {
8181 this . stats = stats || smartRequire ( statsFile )
82+ this . outputPath = outputPath || this . stats . outputPath
8283 this . statsFile = statsFile
8384 this . entrypoints = Array . isArray ( entrypoints ) ? entrypoints : [ entrypoints ]
8485 this . chunks = [ ]
@@ -101,7 +102,7 @@ class ChunkExtractor {
101102 scriptType : extensionToScriptType ( path . extname ( filename ) . toLowerCase ( ) ) ,
102103 chunk,
103104 url : this . resolvePublicUrl ( filename ) ,
104- path : path . join ( this . stats . outputPath , filename ) ,
105+ path : path . join ( this . outputPath , filename ) ,
105106 type,
106107 linkType,
107108 }
You can’t perform that action at this time.
0 commit comments