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

@studyportals/bob-manifest-generator

Package Overview
Dependencies
Maintainers
12
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@studyportals/bob-manifest-generator - npm Package Compare versions

Comparing version 3.0.0-beta.4 to 3.0.0-beta.5

src/plugins/generic-manifest-generator.js

2

package.json
{
"name": "@studyportals/bob-manifest-generator",
"version": "3.0.0-beta.4",
"version": "3.0.0-beta.5",
"description": "A Webpack plugin that generates a manifest file for your microservice.",

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

const fs = require('fs');
const GenericManifestGenerator = require("./generic-manifest-generator");

@@ -20,7 +21,8 @@ class DllManifestGenerator {

const compilationHook = (compilation, callback) => {
this.gatherPackageInfo(compilation);
this.gatherAssets(compilation.assets);
this.emitManifest(compilation);
const assets = compilation.getAssets();
this.gatherPackageInfo(assets);
this.gatherAssets(assets);
GenericManifestGenerator.emitFile(assets, 'manifest.json', this.manifest);
callback();

@@ -45,3 +47,3 @@ };

gatherPackageInfo(compilation) {
gatherPackageInfo(assets) {

@@ -68,4 +70,4 @@ let packageFile;

this.emitStylesheet(compilation, packageFile.style);
this.emitSourcemap(compilation, packageFile.style);
this.emitStylesheet(assets, packageFile.style);
this.emitSourcemap(assets, packageFile.style);

@@ -79,29 +81,16 @@ this.manifest.assets.css.push({

gatherAssets(files) {
for(let file in files) {
if(this.shouldProcessExtension(file, 'js')) {
this.manifest.assets.js.push({
url: file.replace(".min", "")
});
files.forEach(file => {
if (!this.shouldProcessExtension(file.name, 'js')) {
return;
}
}
this.manifest.assets.js.push({
url: file.name.replace(".min", "")
});
});
}
emitManifest(compilation) {
emitStylesheet(assets, file) {
compilation.assets['manifest.json'] = {
source: () => {
return JSON.stringify(this.manifest);
},
size: () => {
return JSON.stringify(this.manifest).length;
}
}
}
emitStylesheet(compilation, file) {
try {

@@ -114,12 +103,3 @@

compilation.assets[file] = {
source: () => {
return stylesheet.toString();
},
size: () => {
return stylesheet.toString().length;
}
}
GenericManifestGenerator.emitFile(assets, file, stylesheet);
} catch(e) {

@@ -131,3 +111,3 @@

emitSourcemap(compilation, file) {
emitSourcemap(assets, file) {

@@ -141,12 +121,3 @@ try {

compilation.assets[file + ".map"] = {
source: () => {
return sourcemap.toString();
},
size: () => {
return sourcemap.toString().length;
}
}
GenericManifestGenerator.emitFile(assets, file, sourcemap);
} catch(e) {

@@ -153,0 +124,0 @@

const path = require('path');
const fs = require('fs');
const DllReferencePlugin = require('./dll-reference-plugin');
const GenericManifestGenerator = require("./generic-manifest-generator");

@@ -31,3 +32,3 @@ class ManifestGenerator {

this.gatherAssets(assets, compilation.chunks);
this.emitManifest(compilation);
GenericManifestGenerator.emitFile(assets, 'manifest.json', this.manifest);

@@ -133,3 +134,3 @@ callback();

this.manifest.assets.js.push({
url: this.baseURL + '/' + file.name,
url: `${this.baseURL}/${file.name}`,
async: this.matchFile(file.name, this.async)

@@ -141,3 +142,3 @@ });

this.manifest.assets.css.push({
url: this.baseURL + '/' + file.name,
url: `${this.baseURL}/${file.name}`,
defer: this.matchFile(file.name, this.defer)

@@ -154,16 +155,2 @@ });

emitManifest(compilation) {
compilation.assets['manifest.json'] = {
source: () => {
return JSON.stringify(this.manifest);
},
size: () => {
return JSON.stringify(this.manifest).length;
}
}
}
fileType(file) {

@@ -170,0 +157,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