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

assets-webpack-plugin

Package Overview
Dependencies
Maintainers
2
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.9.3 to 3.9.4

4

changelog.md

@@ -11,2 +11,6 @@ # Change Log

## 3.9.4 - 2018-08-08
- Adds the `includeAllFileTypes`, and `fileTypes` options for controlling which files are included in the assets file.
## 3.9.3 - 2018-08-07

@@ -13,0 +17,0 @@

32

dist/index.js

@@ -23,3 +23,5 @@ 'use strict';

manifestFirst: true,
useCompilerPath: false
useCompilerPath: false,
fileTypes: ['js', 'css'],
includeAllFileTypes: true
}, options);

@@ -35,3 +37,3 @@ this.writer = createQueuedWriter(createOutputWriter(this.options));

self.options.path = path.resolve(self.options.useCompilerPath ? compiler.options.output.path : self.options.path || '.');
self.options.path = path.resolve(self.options.useCompilerPath ? compiler.options.output.path || '.' : self.options.path || '.');

@@ -80,16 +82,18 @@ var afterEmit = function afterEmit(compilation, callback) {

var typeName = getAssetKind(options, asset);
var combinedPath = assetPath && assetPath.slice(-1) !== '/' ? assetPath + '/' + asset : assetPath + asset;
var type = _typeof(typeMap[typeName]);
if (type === 'undefined') {
typeMap[typeName] = combinedPath;
} else {
if (type === 'string') {
typeMap[typeName] = [typeMap[typeName]];
if (self.options.includeAllFileTypes || self.options.fileTypes.includes(typeName)) {
var combinedPath = assetPath && assetPath.slice(-1) !== '/' ? assetPath + '/' + asset : assetPath + asset;
var type = _typeof(typeMap[typeName]);
if (type === 'undefined') {
typeMap[typeName] = combinedPath;
} else {
if (type === 'string') {
typeMap[typeName] = [typeMap[typeName]];
}
typeMap[typeName].push(combinedPath);
}
typeMap[typeName].push(combinedPath);
added = true;
seenAssets[asset] = true;
return typeMap;
}
added = true;
seenAssets[asset] = true;
return typeMap;
}, {});

@@ -96,0 +100,0 @@

@@ -19,3 +19,5 @@ var fs = require('fs')

manifestFirst: true,
useCompilerPath: false
useCompilerPath: false,
fileTypes: ['js', 'css'],
includeAllFileTypes: true
}, options)

@@ -32,3 +34,3 @@ this.writer = createQueuedWriter(createOutputWriter(this.options))

self.options.path = path.resolve(self.options.useCompilerPath
? compiler.options.output.path : self.options.path || '.')
? (compiler.options.output.path || '.') : (self.options.path || '.'))

@@ -77,16 +79,18 @@ var afterEmit = (compilation, callback) => {

var typeName = getAssetKind(options, asset)
var combinedPath = assetPath && assetPath.slice(-1) !== '/' ? `${assetPath}/${asset}` : assetPath + asset
var type = typeof typeMap[typeName]
if (type === 'undefined') {
typeMap[typeName] = combinedPath
} else {
if (type === 'string') {
typeMap[typeName] = [typeMap[typeName]]
if (self.options.includeAllFileTypes || self.options.fileTypes.includes(typeName)) {
var combinedPath = assetPath && assetPath.slice(-1) !== '/' ? `${assetPath}/${asset}` : assetPath + asset
var type = typeof typeMap[typeName]
if (type === 'undefined') {
typeMap[typeName] = combinedPath
} else {
if (type === 'string') {
typeMap[typeName] = [typeMap[typeName]]
}
typeMap[typeName].push(combinedPath)
}
typeMap[typeName].push(combinedPath)
added = true
seenAssets[asset] = true
return typeMap
}
added = true
seenAssets[asset] = true
return typeMap
}, {})

@@ -93,0 +97,0 @@

{
"name": "assets-webpack-plugin",
"version": "3.9.3",
"version": "3.9.4",
"description": "Emits a json file with assets paths",

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

@@ -232,2 +232,22 @@ # assets-webpack-plugin

#### `includeAllFileTypes`
Optional. `true` by default.
When set false, falls back to the `fileTypes` option array to decide while file types to include in the assets file.
```js
new AssetsPlugin({includeAllFileTypes: false})
```
#### `fileTypes`
Optional. ```['js', 'css']``` by default.
When set and `includeAllFileTypes` is set false, only assets matching these types will be included in the assets file.
```js
new AssetsPlugin({fileTypes: ['js', 'jpg']]})
```
### Using in multi-compiler mode

@@ -234,0 +254,0 @@

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