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

@serwist/webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serwist/webpack-plugin - npm Package Compare versions

Comparing version 9.0.0-preview.16 to 9.0.0-preview.17

3

dist/index.js

@@ -138,3 +138,4 @@ import { transformManifest, getSourceMapURL, stringify, escapeRegExp, replaceAndUpdateSourceMap } from '@serwist/build';

modifyURLPrefix: config.modifyURLPrefix,
transformParam: compilation
transformParam: compilation,
disablePrecacheManifest: config.disablePrecacheManifest
});

@@ -141,0 +142,0 @@ for (const warning of warnings){

import type { Compiler } from "webpack";
import type { InjectManifestOptions } from "./lib/types.js";
import type { InjectManifestOptions, InjectManifestOptionsComplete } from "./lib/types.js";
/**

@@ -26,3 +26,3 @@ * This class supports compiling a service worker file provided via `swSrc`,

export declare class InjectManifest {
protected config: InjectManifestOptions;
protected config: InjectManifestOptionsComplete;
private alreadyCalled;

@@ -29,0 +29,0 @@ private webpack;

import type { ManifestEntry } from "@serwist/build";
import type { Compilation } from "webpack";
import type { InjectManifestOptions } from "./types.js";
export declare const getManifestEntriesFromCompilation: (compilation: Compilation, config: InjectManifestOptions) => Promise<{
import type { InjectManifestOptionsComplete } from "./types.js";
export declare const getManifestEntriesFromCompilation: (compilation: Compilation, config: InjectManifestOptionsComplete) => Promise<{
size: number;

@@ -6,0 +6,0 @@ sortedEntries: ManifestEntry[] | undefined;

@@ -38,12 +38,12 @@ import { z } from "zod";

integrity: z.ZodOptional<z.ZodString>;
revision: z.ZodNullable<z.ZodString>;
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
url: z.ZodString;
}, "strict", z.ZodTypeAny, {
revision: string | null;
url: string;
integrity?: string | undefined;
revision?: string | null | undefined;
}, {
revision: string | null;
url: string;
integrity?: string | undefined;
revision?: string | null | undefined;
}>]>, "many">>;

@@ -54,31 +54,31 @@ disablePrecacheManifest: z.ZodDefault<z.ZodBoolean>;

integrity: z.ZodOptional<z.ZodString>;
revision: z.ZodNullable<z.ZodString>;
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
url: z.ZodString;
size: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}, {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}>, "many">, z.ZodOptional<z.ZodUnknown>], null>, z.ZodUnion<[z.ZodPromise<z.ZodObject<{
manifest: z.ZodArray<z.ZodObject<{
integrity: z.ZodOptional<z.ZodString>;
revision: z.ZodNullable<z.ZodString>;
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
url: z.ZodString;
size: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}, {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}>, "many">;

@@ -88,6 +88,6 @@ warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;

manifest: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[];

@@ -97,6 +97,6 @@ warnings?: string[] | undefined;

manifest: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[];

@@ -107,15 +107,15 @@ warnings?: string[] | undefined;

integrity: z.ZodOptional<z.ZodString>;
revision: z.ZodNullable<z.ZodString>;
revision: z.ZodOptional<z.ZodNullable<z.ZodString>>;
url: z.ZodString;
size: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}, {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}>, "many">;

@@ -125,6 +125,6 @@ warnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;

manifest: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[];

@@ -134,6 +134,6 @@ warnings?: string[] | undefined;

manifest: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[];

@@ -160,18 +160,18 @@ warnings?: string[] | undefined;

additionalPrecacheEntries?: (string | {
revision: string | null;
url: string;
integrity?: string | undefined;
revision?: string | null | undefined;
})[] | undefined;
dontCacheBustURLsMatching?: RegExp | undefined;
manifestTransforms?: ((args_0: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[], args_1: unknown) => {
manifest: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[];

@@ -181,6 +181,6 @@ warnings?: string[] | undefined;

manifest: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[];

@@ -199,5 +199,5 @@ warnings?: string[] | undefined;

additionalPrecacheEntries?: (string | {
revision: string | null;
url: string;
integrity?: string | undefined;
revision?: string | null | undefined;
})[] | undefined;

@@ -207,12 +207,12 @@ disablePrecacheManifest?: boolean | undefined;

manifestTransforms?: ((args_0: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[], args_1: unknown) => {
manifest: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[];

@@ -222,6 +222,6 @@ warnings?: string[] | undefined;

manifest: {
revision: string | null;
url: string;
size: number;
integrity?: string | undefined;
revision?: string | null | undefined;
}[];

@@ -228,0 +228,0 @@ warnings?: string[] | undefined;

{
"name": "@serwist/webpack-plugin",
"version": "9.0.0-preview.16",
"version": "9.0.0-preview.17",
"type": "module",

@@ -59,3 +59,3 @@ "description": "A plugin for your webpack build process, helping you generate a manifest of local files that should be precached.",

"zod": "3.22.4",
"@serwist/build": "9.0.0-preview.16"
"@serwist/build": "9.0.0-preview.17"
},

@@ -68,4 +68,4 @@ "devDependencies": {

"webpack": "5.91.0",
"@serwist/constants": "9.0.0-preview.16",
"@serwist/utils": "9.0.0-preview.16"
"@serwist/constants": "9.0.0-preview.17",
"@serwist/utils": "9.0.0-preview.17"
},

@@ -72,0 +72,0 @@ "peerDependencies": {

@@ -5,3 +5,3 @@ import { escapeRegExp, replaceAndUpdateSourceMap, stringify } from "@serwist/build";

import type { Compilation, Compiler, WebpackError, default as Webpack } from "webpack";
import type { InjectManifestOptions } from "./lib/types.js";
import type { InjectManifestOptions, InjectManifestOptionsComplete } from "./lib/types.js";
import { validateInjectManifestOptions } from "./lib/validator.js";

@@ -40,3 +40,3 @@

export class InjectManifest {
protected config: InjectManifestOptions;
protected config: InjectManifestOptionsComplete;
private alreadyCalled: boolean;

@@ -49,3 +49,4 @@ private webpack: typeof Webpack;

constructor(config: InjectManifestOptions) {
this.config = config;
// We are essentially lying to TypeScript.
this.config = config as InjectManifestOptionsComplete;
this.alreadyCalled = false;

@@ -78,3 +79,3 @@ this.webpack = null!;

*/
private async getManifestEntries(compilation: Compilation, config: InjectManifestOptions) {
private async getManifestEntries(compilation: Compilation, config: InjectManifestOptionsComplete) {
if (config.disablePrecacheManifest) {

@@ -243,3 +244,3 @@ return {

const globalRegexp = new RegExp(escapeRegExp(config.injectionPoint!), "g");
const globalRegexp = new RegExp(escapeRegExp(config.injectionPoint), "g");
const injectionResults = swAssetString.match(globalRegexp);

@@ -246,0 +247,0 @@

@@ -15,3 +15,3 @@ /*

import { resolveWebpackURL } from "./resolve-webpack-url.js";
import type { InjectManifestOptions } from "./types.js";
import type { InjectManifestOptions, InjectManifestOptionsComplete } from "./types.js";

@@ -182,3 +182,3 @@ /**

compilation: Compilation,
config: InjectManifestOptions,
config: InjectManifestOptionsComplete,
): Promise<{ size: number; sortedEntries: ManifestEntry[] | undefined }> => {

@@ -194,3 +194,3 @@ const filteredAssets = filterAssets(compilation, config);

size: asset.source.size() || 0,
} as FileDetails;
} satisfies FileDetails;
});

@@ -206,2 +206,3 @@

transformParam: compilation,
disablePrecacheManifest: config.disablePrecacheManifest,
});

@@ -208,0 +209,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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