Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

assets-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assets-webpack-plugin - npm Package Compare versions

Comparing version 3.1.0 to 3.2.0

6

lib/output/createOutputWriter.js

@@ -14,2 +14,6 @@ var mkdirp = require('mkdirp');

options.processOutput = options.processOutput || function (assets) {
return JSON.stringify(assets, null, options.prettyPrint ? 2 : null);
};
return function writeOutput (newAssets, next) {

@@ -40,3 +44,3 @@ // if potions.update is false and we're on the first pass of a (possibly) multicompiler

var assets = merge({}, oldAssets, newAssets);
var output = JSON.stringify(assets, null, options.prettyPrint ? 2 : null);
var output = options.processOutput(assets);

@@ -43,0 +47,0 @@ fs.writeFile(outputPath, output, function (err) {

2

package.json
{
"name": "assets-webpack-plugin",
"version": "3.1.0",
"version": "3.2.0",
"description": "Emits a json file with assets paths",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -91,18 +91,22 @@ assets-webpack-plugin

__path__: Path where to save the created json file. Defaults to the current directory.
__filename__: Name for the created json file. Defaults to `webpack-assets.json`
```js
new AssetsPlugin({path: path.join(__dirname, 'app', 'views')})
new AssetsPlugin({filename: 'assets.json'})
```
__filename__: Name for the created json file. Defaults to `webpack-assets.json`
__fullPath__: True by default. If false the output will not include the full path of the generated file.
```js
new AssetsPlugin({filename: 'assets.json'})
new AssetsPlugin({fullPath: false})
```
__update__: When set to true, the output json file will be updated instead of overwritten. Defaults to false.
e.g.
`/public/path/bundle.js` vs `bundle.js vs`
__path__: Path where to save the created json file. Defaults to the current directory.
```js
new AssetsPlugin({update: true})
new AssetsPlugin({path: path.join(__dirname, 'app', 'views')})
```

@@ -116,2 +120,18 @@

__processOutput__: Formats the assets output. Defaults is JSON stringify function.
```js
new AssetsPlugin({
processOutput: function (assets) {
return 'window.staticMap = ' + JSON.stringify(assets);
}
})
```
__update__: When set to true, the output json file will be updated instead of overwritten. Defaults to false.
```js
new AssetsPlugin({update: true})
```
### Using in multi-compiler mode

@@ -178,1 +198,8 @@

```
## Changelog
__3.2.0__ Added `processOutput` option
__3.1.0__ Config now accepts a `fullPath` option.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc