UNPKG

1.78 kBMarkdownView Raw
1# Installation
2> `npm install --save @types/sw-precache-webpack-plugin`
3
4# Summary
5This package contains type definitions for sw-precache-webpack-plugin (https://github.com/goldhand/sw-precache-webpack-plugin#readme).
6
7# Details
8Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sw-precache-webpack-plugin.
9## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sw-precache-webpack-plugin/index.d.ts)
10````ts
11import { Options as SwPrecacheOptions } from "sw-precache";
12import { Plugin } from "webpack";
13
14// workaround to override parent types
15interface _Options extends SwPrecacheOptions {
16 importScripts?: any;
17}
18
19declare namespace SWPrecacheWebpackPlugin {
20 interface Options extends _Options {
21 filename?: string | undefined;
22 filepath?: string | undefined;
23 staticFileGlobsIgnorePatterns?: RegExp[] | undefined;
24 mergeStaticsConfig?: boolean | undefined;
25 minify?: boolean | undefined;
26
27 // override sw-precache options
28 importScripts?:
29 | Array<
30 | string
31 | {
32 chunkName?: string | undefined;
33 filename?: string | undefined;
34 }
35 >
36 | undefined;
37 }
38}
39
40declare class SWPrecacheWebpackPlugin extends Plugin {
41 constructor(options?: SWPrecacheWebpackPlugin.Options);
42}
43
44export = SWPrecacheWebpackPlugin;
45
46````
47
48### Additional Details
49 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
50 * Dependencies: [@types/sw-precache](https://npmjs.com/package/@types/sw-precache), [@types/webpack](https://npmjs.com/package/@types/webpack)
51
52# Credits
53These definitions were written by [JounQin](https://github.com/JounQin).
54
\No newline at end of file