diff --git a/notNeededPackages.json b/notNeededPackages.json index 3a8cd95963d115..8dc4e50cf6815e 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -8171,6 +8171,10 @@ "libraryName": "webmidi", "asOfVersion": "3.0.1" }, + "webpack-assets-manifest": { + "libraryName": "webpack-assets-manifest", + "asOfVersion": "6.0.0" + }, "webpack-chain": { "libraryName": "webpack-chain", "asOfVersion": "5.2.0" diff --git a/types/three/src/math/Interpolant.d.ts b/types/three/src/math/Interpolant.d.ts index 3acabddddbe68a..fd6992dadec14d 100644 --- a/types/three/src/math/Interpolant.d.ts +++ b/types/three/src/math/Interpolant.d.ts @@ -57,7 +57,7 @@ export abstract class Interpolant { * * @type {TypedArray} */ - valueSize: TypedArray; + valueSize: number; /** * The interpolation settings. * diff --git a/types/webpack-assets-manifest/.eslintrc.json b/types/webpack-assets-manifest/.eslintrc.json deleted file mode 100644 index 463ca450fe2088..00000000000000 --- a/types/webpack-assets-manifest/.eslintrc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "rules": { - "@definitelytyped/no-single-element-tuple-type": "off", - "@typescript-eslint/no-empty-interface": "off", - "no-duplicate-imports": "off", - "@typescript-eslint/triple-slash-reference": "off", - "@typescript-eslint/no-unsafe-function-type": "off", - "@typescript-eslint/no-wrapper-object-types": "off", - "@typescript-eslint/naming-convention": "off", - "@typescript-eslint/consistent-type-definitions": "off", - "@typescript-eslint/explicit-member-accessibility": "off", - "@typescript-eslint/no-misused-new": "off" - } -} diff --git a/types/webpack-assets-manifest/.npmignore b/types/webpack-assets-manifest/.npmignore deleted file mode 100644 index 62191506c25333..00000000000000 --- a/types/webpack-assets-manifest/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts -/v4/ diff --git a/types/webpack-assets-manifest/index.d.ts b/types/webpack-assets-manifest/index.d.ts deleted file mode 100644 index b7703fe947f734..00000000000000 --- a/types/webpack-assets-manifest/index.d.ts +++ /dev/null @@ -1,248 +0,0 @@ -/// - -import { AsyncSeriesHook, SyncHook, SyncWaterfallHook } from "tapable"; -import { Asset, Compilation, Compiler, LoaderContext, Module, Stats, WebpackPluginInstance } from "webpack"; - -declare class WebpackAssetsManifest implements WebpackPluginInstance { - constructor(options?: WebpackAssetsManifest.Options); - - /** https://github.com/webdeveric/webpack-assets-manifest#hooks */ - hooks: { - apply: SyncHook<[WebpackAssetsManifest]>; - - customize: SyncWaterfallHook< - [WebpackAssetsManifest.Entry, WebpackAssetsManifest.Entry, WebpackAssetsManifest, Asset | null] - >; - - transform: SyncWaterfallHook<[WebpackAssetsManifest.Assets, WebpackAssetsManifest]>; - - done: AsyncSeriesHook<[WebpackAssetsManifest, Stats]>; - - options: SyncWaterfallHook<[WebpackAssetsManifest.Options]>; - - afterOptions: SyncHook<[WebpackAssetsManifest.Options]>; - }; - - /** https://github.com/webdeveric/webpack-assets-manifest#options-read-the-schema */ - options: WebpackAssetsManifest.Options; - - /** This is what gets JSON stringified */ - assets: WebpackAssetsManifest.Assets; - - /** original filename : hashed filename */ - assetNames: Map; - - /** This is passed to the customize() hook */ - currentAsset: Asset | null; - - /** The Webpack compiler instance */ - compiler: Compiler | null; - - /** Hook into the Webpack compiler */ - apply(compiler: Compiler): void; - - /** https://github.com/webdeveric/webpack-assets-manifest#options-read-the-schema */ - get defaultOptions(): WebpackAssetsManifest.Options; - - /** Determine if the manifest data is currently being merged */ - get isMerging(): boolean; - - /** Get the file extension */ - getExtension(filename: string): string; - - /** Replace backslash with forward slash */ - fixKey(key: string): string; - - /** Add item to assets without modifying the key or value */ - setRaw(key: string, value: unknown): this; - - /** Add an item to the manifest */ - set(key: string, value: unknown): this; - - /** Determine if an item exist in the manifest */ - has(key: string): boolean; - - /** Get an item from the manifest */ - get(key: string, defaultValue?: unknown): unknown; - - /** Delete an item from the manifest */ - delete(key: string): boolean; - - /** Process compilation assets */ - processAssetsByChunkName( - assets: Record, - hmrFiles?: Set, - ): this["assetNames"]; - - /** Get the data for `JSON.stringify()` */ - toJSON(): unknown; - - /** `JSON.stringify()` the manifest */ - toString(): string; - - /** Merge data if the output file already exists */ - maybeMerge(): void; - - /** Emit the assets manifest */ - emitAssetsManifest(compilation: Compilation): Promise; - - /** Record details of Asset Modules */ - handleProcessAssetsAnalyse(compilation: Compilation): void; - - /** - * When using webpack 5 persistent cache, loaderContext.emitFile sometimes doesn't - * get called and so the asset names are not recorded. To work around this, lets - * loops over the stats.assets and record the asset names. - */ - processStatsAssets(assets: readonly Asset[]): void; - - /** Get assets and hot module replacement files from a compilation object */ - getCompilationAssets(compilation: Compilation): { assets: Asset[]; hmrFiles: Set }; - - /** Gather asset details */ - handleProcessAssetsReport(compilation: Compilation): Promise; - - /** Get the parsed output path. [hash] is supported. */ - getManifestPath(compilation: Compilation, filename: string): string; - - /** Write the asset manifest to the file system */ - writeTo(destination: string): Promise; - - clear(): void; - - /** Cleanup before running Webpack */ - handleWatchRun(): void; - - /** Determine if the manifest should be written to disk with fs */ - shouldWriteToDisk(compilation: Compilation): boolean; - - /** Last chance to write the manifest to disk */ - handleAfterEmit(compilation: Compilation): Promise; - - /** Record asset names */ - handleNormalModuleLoader(compilation: Compilation, loaderContext: LoaderContext, module: Module): void; - - /** Add the SRI hash to the assetsInfo map */ - recordSubresourceIntegrity(compilation: Compilation): void; - - /** Hook into compilation objects */ - handleCompilation(compilation: Compilation): void; - - /** Hook into the compilation object */ - handleThisCompilation(compilation: Compilation): void; - - /** - * Determine if webpack-dev-server is being used - * - * The WEBPACK_DEV_SERVER / WEBPACK_SERVE env vars cannot be relied upon. - * See issue {@link https://github.com/webdeveric/webpack-assets-manifest/issues/125|#125} - */ - inDevServer(): boolean; - - /** Get the file system path to the manifest */ - getOutputPath(): string; - - /** Get the public path for the filename */ - getPublicPath(filename: string): string; - - /** - * Get a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler|Proxy} for the manifest. - * This allows you to use `[]` to manage entries. - * - * @param raw - Should the proxy use `setRaw` instead of `set`? - */ - getProxy(raw?: boolean): WebpackAssetsManifest.Assets; -} - -declare namespace WebpackAssetsManifest { - interface Options { - /** https://github.com/webdeveric/webpack-assets-manifest#enabled */ - enabled?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#assets */ - assets?: Assets | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#output */ - output?: string | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#replacer */ - replacer?: - | ((this: unknown, key: string, value: unknown) => unknown) - | ReadonlyArray - | null - | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#space */ - space?: number | string | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#writetodisk */ - writeToDisk?: boolean | "auto" | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#fileextregex */ - fileExtRegex?: RegExp | null | false | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#sortmanifest */ - sortManifest?: boolean | ((this: WebpackAssetsManifest, a: string, b: string) => number) | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#merge */ - merge?: boolean | "customize" | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#publicpath */ - publicPath?: - | string - | boolean - | null - | ((filename: string, manifest: WebpackAssetsManifest) => string) - | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#contextrelativekeys */ - contextRelativeKeys?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#apply */ - apply?: ((manifest: WebpackAssetsManifest) => void) | null | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#customize */ - customize?: - | ((entry: Entry, original: Entry, manifest: WebpackAssetsManifest, asset: Asset | null) => Entry | false) - | null - | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#transform */ - transform?: ((assets: Assets, manifest: WebpackAssetsManifest) => unknown) | null | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#done */ - done?: ((manifest: WebpackAssetsManifest, stats: Stats) => void) | null | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#entrypoints */ - entrypoints?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#entrypointskey */ - entrypointsKey?: string | false | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#entrypointsuseassets */ - entrypointsUseAssets?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#integrity */ - integrity?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#integrityhashes */ - integrityHashes?: readonly string[] | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#integritypropertyname */ - integrityPropertyName?: string | undefined; - /** - * A place to put your arbitrary data - * @default {} - */ - extra?: Record | undefined; - } - - interface Entry { - key: string; - value: string; - } - - interface Assets extends Record {} -} - -export = WebpackAssetsManifest; diff --git a/types/webpack-assets-manifest/package.json b/types/webpack-assets-manifest/package.json deleted file mode 100644 index 07d3654c6453ab..00000000000000 --- a/types/webpack-assets-manifest/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "private": true, - "name": "@types/webpack-assets-manifest", - "version": "5.1.9999", - "projects": [ - "https://github.com/webdeveric/webpack-assets-manifest" - ], - "dependencies": { - "@types/node": "*", - "tapable": "^2.2.0", - "webpack": "^5" - }, - "devDependencies": { - "@types/webpack-assets-manifest": "workspace:." - }, - "owners": [ - { - "name": "Franklin Tse", - "githubUsername": "FranklinWhale" - } - ] -} diff --git a/types/webpack-assets-manifest/tsconfig.json b/types/webpack-assets-manifest/tsconfig.json deleted file mode 100644 index d3da0d951c8944..00000000000000 --- a/types/webpack-assets-manifest/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "webpack-assets-manifest-tests.ts" - ] -} diff --git a/types/webpack-assets-manifest/v4/.npmignore b/types/webpack-assets-manifest/v4/.npmignore deleted file mode 100644 index 93e307400a5456..00000000000000 --- a/types/webpack-assets-manifest/v4/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -* -!**/*.d.ts -!**/*.d.cts -!**/*.d.mts -!**/*.d.*.ts diff --git a/types/webpack-assets-manifest/v4/index.d.ts b/types/webpack-assets-manifest/v4/index.d.ts deleted file mode 100644 index caa87e62ac7f0e..00000000000000 --- a/types/webpack-assets-manifest/v4/index.d.ts +++ /dev/null @@ -1,240 +0,0 @@ -import { AsyncSeriesHook, SyncHook, SyncWaterfallHook } from "tapable"; -import { compilation, Compiler, loader, Plugin, Stats } from "webpack"; - -declare class WebpackAssetsManifest extends Plugin { - constructor(options?: WebpackAssetsManifest.Options); - - /** https://github.com/webdeveric/webpack-assets-manifest#hooks */ - hooks: { - apply: SyncHook; - - /** - * The `SyncWaterfallHook` class supports 3 type parameters only but this hook actually has 4 parameters. - * The type of 4th parameter is `compilation.Asset | null` with integrity added to info field. - * - * Refer to https://github.com/webdeveric/webpack-assets-manifest#hooks for details - */ - customize: SyncWaterfallHook; - - transform: SyncWaterfallHook; - - done: AsyncSeriesHook; - - options: SyncWaterfallHook; - - afterOptions: SyncHook; - }; - - /** https://github.com/webdeveric/webpack-assets-manifest#options-read-the-schema */ - options: WebpackAssetsManifest.Options; - - /** This is what gets JSON stringified */ - assets: WebpackAssetsManifest.Assets; - - /** original filename : hashed filename */ - assetNames: Map; - - /** This is passed to the customize() hook */ - currentAsset: compilation.Asset | null; - - /** The Webpack compiler instance */ - compiler: Compiler | null; - - /** https://github.com/webdeveric/webpack-assets-manifest#options-read-the-schema */ - get defaultOptions(): WebpackAssetsManifest.Options; - - /** Determine if the manifest data is currently being merged */ - get isMerging(): boolean; - - /** Get the file extension */ - getExtension(filename: string): string; - - /** Replace backslash with forward slash */ - fixKey(key: string): string; - - /** Add item to assets without modifying the key or value */ - setRaw(key: string, value: unknown): this; - - /** Add an item to the manifest */ - set(key: string, value: unknown): this; - - /** Determine if an item exist in the manifest */ - has(key: string): boolean; - - /** Get an item from the manifest */ - get(key: string, defaultValue?: unknown): unknown; - - /** Delete an item from the manifest */ - delete(key: string): boolean; - - /** Process compilation assets */ - processAssetsByChunkName( - assets: Record, - hmrFiles?: Set, - ): this["assetNames"]; - - /** Get the data for `JSON.stringify()` */ - toJSON(): unknown; - - /** `JSON.stringify()` the manifest */ - toString(): string; - - /** Merge data if the output file already exists */ - maybeMerge(): void; - - /** Emit the assets manifest */ - emitAssetsManifest(compilation: compilation.Compilation): Promise; - - /** Get assets and hot module replacement files from a compilation object */ - getCompilationAssets(compilation: compilation.Compilation): { assets: compilation.Asset[]; hmrFiles: Set }; - - /** Handle the `emit` event */ - handleEmit(compilation: compilation.Compilation): Promise; - - /** Get the parsed output path. [hash] is supported. */ - getManifestPath(compilation: compilation.Compilation, filename: string): string; - - /** Write the asset manifest to the file system */ - writeTo(destination: string): Promise; - - clear(): void; - - /** Cleanup before running Webpack */ - handleWatchRun(): void; - - /** Determine if the manifest should be written to disk with fs */ - shouldWriteToDisk(compilation: compilation.Compilation): boolean; - - /** Last chance to write the manifest to disk */ - handleAfterEmit(compilation: compilation.Compilation): Promise; - - /** Record asset names */ - handleNormalModuleLoader( - compilation: compilation.Compilation, - loaderContext: loader.LoaderContext, - module: compilation.Module, - ): void; - - /** Add the SRI hash to the assetsInfo map */ - recordSubresourceIntegrity(compilation: compilation.Compilation): void; - - /** Hook into the compilation object */ - handleCompilation(compilation: compilation.Compilation): void; - - /** - * Determine if webpack-dev-server is being used - * - * The WEBPACK_DEV_SERVER / WEBPACK_SERVE env vars cannot be relied upon. - * See issue {@link https://github.com/webdeveric/webpack-assets-manifest/issues/125|#125} - */ - inDevServer(): boolean; - - /** Get the file system path to the manifest */ - getOutputPath(): string; - - /** Get the public path for the filename */ - getPublicPath(filename: string): string; - - /** - * Get a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler|Proxy} for the manifest. - * This allows you to use `[]` to manage entries. - * - * @param raw - Should the proxy use `setRaw` instead of `set`? - */ - getProxy(raw?: boolean): WebpackAssetsManifest.Assets; -} - -declare namespace WebpackAssetsManifest { - interface Options { - /** https://github.com/webdeveric/webpack-assets-manifest#enabled */ - enabled?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#assets */ - assets?: Assets | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#output */ - output?: string | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#replacer */ - replacer?: - | ((this: unknown, key: string, value: unknown) => unknown) - | ReadonlyArray - | null - | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#space */ - space?: number | string | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#writetodisk */ - writeToDisk?: boolean | "auto" | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#fileextregex */ - fileExtRegex?: RegExp | null | false | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#sortmanifest */ - sortManifest?: boolean | ((this: WebpackAssetsManifest, a: string, b: string) => number) | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#merge */ - merge?: boolean | "customize" | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#publicpath */ - publicPath?: - | string - | boolean - | null - | ((filename: string, manifest: WebpackAssetsManifest) => string) - | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#contextrelativekeys */ - contextRelativeKeys?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#apply */ - apply?: ((manifest: WebpackAssetsManifest) => void) | null | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#customize */ - customize?: - | (( - entry: Entry, - original: Entry, - manifest: WebpackAssetsManifest, - asset: (compilation.Asset & { info: Record }) | null, - ) => Entry | false) - | null - | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#transform */ - transform?: ((assets: Assets, manifest: WebpackAssetsManifest) => unknown) | null | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#done */ - done?: ((manifest: WebpackAssetsManifest, stats: Stats) => void) | null | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#entrypoints */ - entrypoints?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#entrypointskey */ - entrypointsKey?: string | false | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#entrypointsuseassets */ - entrypointsUseAssets?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#integrity */ - integrity?: boolean | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#integrityhashes */ - integrityHashes?: readonly string[] | undefined; - - /** https://github.com/webdeveric/webpack-assets-manifest#integritypropertyname */ - integrityPropertyName?: string | undefined; - } - - interface Entry { - key: string; - value: string; - } - - interface Assets { - [key: string]: unknown; - } -} - -export = WebpackAssetsManifest; diff --git a/types/webpack-assets-manifest/v4/package.json b/types/webpack-assets-manifest/v4/package.json deleted file mode 100644 index b49244a75a1f0f..00000000000000 --- a/types/webpack-assets-manifest/v4/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "name": "@types/webpack-assets-manifest", - "version": "4.0.9999", - "projects": [ - "https://github.com/webdeveric/webpack-assets-manifest" - ], - "dependencies": { - "@types/tapable": "^1", - "@types/webpack": "^4" - }, - "devDependencies": { - "@types/webpack-assets-manifest": "workspace:." - }, - "owners": [ - { - "name": "Franklin Tse", - "githubUsername": "FranklinWhale" - } - ] -} diff --git a/types/webpack-assets-manifest/v4/tsconfig.json b/types/webpack-assets-manifest/v4/tsconfig.json deleted file mode 100644 index d3da0d951c8944..00000000000000 --- a/types/webpack-assets-manifest/v4/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "module": "node16", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "strictFunctionTypes": true, - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "webpack-assets-manifest-tests.ts" - ] -} diff --git a/types/webpack-assets-manifest/v4/webpack-assets-manifest-tests.ts b/types/webpack-assets-manifest/v4/webpack-assets-manifest-tests.ts deleted file mode 100644 index 210d5f0f3badfa..00000000000000 --- a/types/webpack-assets-manifest/v4/webpack-assets-manifest-tests.ts +++ /dev/null @@ -1,121 +0,0 @@ -import WebpackAssetsManifest from "webpack-assets-manifest"; - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/asset-integrity.js */ -new WebpackAssetsManifest({ - output: "asset-integrity-manifest.json", - integrity: true, - publicPath: true, - customize(entry, original, manifest, asset) { - return { - key: entry.value, - value: asset && asset.info.integrity, - }; - }, -}); - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/aws-s3-data-integrity.js */ -new WebpackAssetsManifest({ - output: "aws-s3-data-integrity-manifest.json", - integrity: true, - integrityHashes: ["md5"], - integrityPropertyName: "md5", - publicPath: "s3://some-bucket/some-folder/", - customize(entry, original, manifest, asset) { - return { - key: entry.value, - value: asset && asset.info.md5.substr(4), - }; - }, -}); - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/custom-cdn.js */ -new WebpackAssetsManifest({ - output: "custom-cdn-manifest.json", - publicPath(filename, manifest) { - switch (manifest.getExtension(filename).substr(1).toLowerCase()) { - case "jpg": - case "jpeg": - case "gif": - case "png": - case "svg": - return `https://img.cdn.example.com/${filename}`; - case "css": - return `https://css.cdn.example.com/${filename}`; - case "js": - return `https://js.cdn.example.com/${filename}`; - default: - return `https://cdn.example.com/${filename}`; - } - }, -}); - -/** - * https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/customized.js - * https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/merged.js - */ -new WebpackAssetsManifest({ - output: "customized-manifest.json", - merge: true, - customize(entry, original, manifest, asset) { - if (manifest.isMerging) { - } - - if (entry.key.toLowerCase().endsWith(".map")) { - return false; - } - - return { - key: `src/${entry.key}`, - value: `dist/${entry.value}`, - }; - }, -}); - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/sorted.js */ -new WebpackAssetsManifest({ - output: "sorted-manifest.json", - sortManifest(a, b) { - const extA = this.getExtension(a); - const extB = this.getExtension(b); - - if (extA > extB) { - return 1; - } - - if (extA < extB) { - return -1; - } - - return a.localeCompare(b); - }, -}); - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/transformed.js */ -new WebpackAssetsManifest({ - output: "transformed-manifest.json", - transform(assets, manifest) { - const { name, version } = require("./package.json"); - - assets.package = { - name, - version, - }; - - const entry = { - key: "YourKey", - value: "YourValue", - }; - - const { key, value } = manifest.hooks.customize.call( - { - key: manifest.fixKey(entry.key), - value: manifest.getPublicPath(entry.value), - }, - entry, - manifest, - null, - ); - - assets[key] = value; - }, -}); diff --git a/types/webpack-assets-manifest/webpack-assets-manifest-tests.ts b/types/webpack-assets-manifest/webpack-assets-manifest-tests.ts deleted file mode 100644 index 89749c130171b8..00000000000000 --- a/types/webpack-assets-manifest/webpack-assets-manifest-tests.ts +++ /dev/null @@ -1,125 +0,0 @@ -import WebpackAssetsManifest from "webpack-assets-manifest"; - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/asset-integrity.js */ -new WebpackAssetsManifest({ - output: "asset-integrity-manifest.json", - integrity: true, - publicPath: true, - customize(entry, original, manifest, asset) { - return { - key: entry.value, - value: asset && asset.info.integrity, - }; - }, - extra: {}, -}); - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/aws-s3-data-integrity.js */ -new WebpackAssetsManifest({ - output: "aws-s3-data-integrity-manifest.json", - integrity: true, - integrityHashes: ["md5"], - integrityPropertyName: "md5", - publicPath: "s3://some-bucket/some-folder/", - customize(entry, original, manifest, asset) { - return { - key: entry.value, - value: asset && asset.info.md5.substr(4), - }; - }, - extra: { - test: true, - }, -}); - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/custom-cdn.js */ -new WebpackAssetsManifest({ - output: "custom-cdn-manifest.json", - publicPath(filename, manifest) { - switch (manifest.getExtension(filename).substr(1).toLowerCase()) { - case "jpg": - case "jpeg": - case "gif": - case "png": - case "svg": - return `https://img.cdn.example.com/${filename}`; - case "css": - return `https://css.cdn.example.com/${filename}`; - case "js": - return `https://js.cdn.example.com/${filename}`; - default: - return `https://cdn.example.com/${filename}`; - } - }, -}); - -/** - * https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/customized.js - * https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/merged.js - */ -new WebpackAssetsManifest({ - output: "customized-manifest.json", - merge: true, - customize(entry, original, manifest, asset) { - if (manifest.isMerging) { - } - - if (entry.key.toLowerCase().endsWith(".map")) { - return false; - } - - return { - key: `src/${entry.key}`, - value: `dist/${entry.value}`, - }; - }, -}); - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/sorted.js */ -new WebpackAssetsManifest({ - output: "sorted-manifest.json", - sortManifest(a, b) { - const extA = this.getExtension(a); - const extB = this.getExtension(b); - - if (extA > extB) { - return 1; - } - - if (extA < extB) { - return -1; - } - - return a.localeCompare(b); - }, -}); - -/** https://github.com/webdeveric/webpack-assets-manifest/blob/master/examples/transformed.js */ -new WebpackAssetsManifest({ - output: "transformed-manifest.json", - transform(assets, manifest) { - const { name, version } = require("./package.json"); - - assets.package = { - name, - version, - }; - - const entry = { - key: "YourKey", - value: "YourValue", - }; - - const { key, value } = manifest.hooks.customize.call( - { - key: manifest.fixKey(entry.key), - value: manifest.getPublicPath(entry.value), - }, - entry, - manifest, - null, - ); - - assets[key] = value; - }, -});