assets-webpack-plugin
Advanced tools
Comparing version 6.0.3 to 6.0.4
@@ -8,2 +8,6 @@ # Change Log | ||
## 6.0.4 - 2020-11-13 | ||
* Adds the `includeAuxiliaryAssets` option | ||
* Closes [#302](https://github.com/ztoben/assets-webpack-plugin/issues/302) | ||
## 6.0.2 - 2020-10-16 | ||
@@ -10,0 +14,0 @@ * Closes [#279](https://github.com/ztoben/assets-webpack-plugin/issues/279) |
@@ -5,2 +5,4 @@ 'use strict'; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
var fs = require('fs'); | ||
@@ -28,2 +30,3 @@ var path = require('path'); | ||
includeFilesWithoutChunk: false, | ||
includeAuxiliaryAssets: false, | ||
keepInMemory: false, | ||
@@ -97,2 +100,6 @@ integrity: false, | ||
if (self.options.includeAuxiliaryAssets && stats.entrypoints[chunkName].auxiliaryAssets) { | ||
assets = [].concat(_toConsumableArray(assets), _toConsumableArray(stats.entrypoints[chunkName].auxiliaryAssets)); | ||
} | ||
if (!Array.isArray(assets)) { | ||
@@ -99,0 +106,0 @@ assets = [assets]; |
'use strict'; | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } | ||
var path = require('path'); | ||
@@ -13,4 +13,4 @@ var fs = require('fs'); | ||
function orderAssets(assets, options) { | ||
return options.manifestFirst ? Object.assign.apply(Object, [{}].concat(_toConsumableArray(Object.keys(assets).map(function (i) { | ||
function sortAssets(assets) { | ||
return Object.keys(assets).map(function (i) { | ||
return _defineProperty({}, i, assets[i]); | ||
@@ -27,5 +27,9 @@ }).sort(function (a, b) { | ||
return 0; | ||
})))) : assets; | ||
}); | ||
} | ||
function orderAssets(assets, options) { | ||
return options.manifestFirst ? Object.assign.apply(Object, [{}].concat(_toConsumableArray(sortAssets(assets)))) : assets; | ||
} | ||
module.exports = function (options) { | ||
@@ -32,0 +36,0 @@ var update = options.update; |
@@ -23,2 +23,3 @@ const fs = require('fs') | ||
includeFilesWithoutChunk: false, | ||
includeAuxiliaryAssets: false, | ||
keepInMemory: false, | ||
@@ -96,2 +97,6 @@ integrity: false, | ||
if (self.options.includeAuxiliaryAssets && stats.entrypoints[chunkName].auxiliaryAssets) { | ||
assets = [...assets, ...stats.entrypoints[chunkName].auxiliaryAssets] | ||
} | ||
if (!Array.isArray(assets)) { | ||
@@ -98,0 +103,0 @@ assets = [assets] |
{ | ||
"name": "assets-webpack-plugin", | ||
"version": "6.0.3", | ||
"version": "6.0.4", | ||
"description": "Emits a json file with assets paths", | ||
@@ -41,10 +41,10 @@ "main": "dist/index.js", | ||
"chai": "4.2.0", | ||
"css-loader": "5.0.0", | ||
"mini-css-extract-plugin": "1.0.0", | ||
"mocha": "8.1.3", | ||
"css-loader": "5.0.1", | ||
"mini-css-extract-plugin": "1.3.1", | ||
"mocha": "8.2.1", | ||
"rimraf": "3.0.2", | ||
"snazzy": "8.0.0", | ||
"standard": "14.3.4", | ||
"snazzy": "9.0.0", | ||
"standard": "16.0.2", | ||
"style-loader": "2.0.0", | ||
"webpack": "5.1.3" | ||
"webpack": "5.4.0" | ||
}, | ||
@@ -51,0 +51,0 @@ "dependencies": { |
# assets-webpack-plugin | ||
[![version](https://img.shields.io/npm/v/assets-webpack-plugin.svg)](https://npmjs.org/package/assets-webpack-plugin) | ||
[![downloads](https://img.shields.io/npm/dt/assets-webpack-plugin.svg)](https://npmjs.org/package/assets-webpack-plugin) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) | ||
@@ -356,2 +358,12 @@ [![Build Status](https://travis-ci.org/ztoben/assets-webpack-plugin.svg?branch=master)](https://travis-ci.org/ztoben/assets-webpack-plugin) | ||
#### `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 | ||
@@ -358,0 +370,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41970
611
433