Skip to content

Commit

Permalink
Merge pull request #303 from geldmacher/patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ztoben committed Nov 13, 2020
2 parents b6b32a3 + 05187bc commit e37e54b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function AssetsWebpackPlugin (options) {
fileTypes: ['js', 'css'],
includeAllFileTypes: true,
includeFilesWithoutChunk: false,
includeAuxiliaryAssets: false,
keepInMemory: false,
integrity: false,
removeFullPathAutoPrefix: false
Expand Down Expand Up @@ -91,6 +92,10 @@ AssetsWebpackPlugin.prototype = {
} else {
assets = chunkName ? stats.assetsByChunkName[chunkName] : stats.assets
}

if(self.options.includeAuxiliaryAssets && stats.entrypoints[chunkName].auxiliaryAssets){
assets = [...assets, ...stats.entrypoints[chunkName].auxiliaryAssets];
}

if (!Array.isArray(assets)) {
assets = [assets]
Expand Down
10 changes: 10 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,16 @@ When set and `entrypoints` is set true, will output any files that are part of t
new AssetsPlugin({includeFilesWithoutChunk: true})
```

#### `includeAuxiliaryAssets`

Optional. `false` by default.

When set, will output any files that are part of the chunk and marked as auxiliary assets.

```js
new AssetsPlugin({includeAuxiliaryAssets: true})
```

### Using in multi-compiler mode

If you use webpack multi-compiler mode and want your assets written to a single file,
Expand Down

0 comments on commit e37e54b

Please sign in to comment.