webpack-assets-manifest
Version:
This Webpack plugin will generate a JSON file that matches the original filename with the hashed version.
184 lines (183 loc) • 4.5 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.optionsSchema = void 0;
const node_crypto_1 = require("node:crypto");
exports.optionsSchema = {
title: 'Webpack Assets Manifest options schema',
description: 'Webpack Assets Manifest options',
type: 'object',
additionalProperties: false,
properties: {
enabled: {
type: 'boolean',
default: true,
},
assets: {
type: 'object',
default: {},
},
output: {
type: 'string',
default: 'assets-manifest.json',
},
replacer: {
default: null,
oneOf: [
{
$ref: '#/definitions/functionOrNull',
},
{
type: 'array',
},
],
},
space: {
oneOf: [
{
type: 'integer',
multipleOf: 1.0,
minimum: 0,
},
{
type: 'string',
minLength: 1,
},
],
default: 2,
},
writeToDisk: {
oneOf: [
{
type: 'boolean',
},
{
const: 'auto',
},
],
default: 'auto',
},
fileExtRegex: {
oneOf: [
{
instanceof: 'RegExp',
},
{
type: 'null',
},
{
const: false,
},
],
},
sortManifest: {
default: true,
oneOf: [
{
type: 'boolean',
},
{
instanceof: 'Function',
},
],
},
merge: {
default: false,
oneOf: [
{
type: 'boolean',
},
{
const: 'customize',
},
],
},
publicPath: {
default: null,
oneOf: [
{
type: 'string',
},
{
type: 'boolean',
},
{
type: 'null',
},
{
instanceof: 'Function',
},
],
},
contextRelativeKeys: {
type: 'boolean',
default: false,
},
apply: {
$ref: '#/definitions/functionOrNull',
},
customize: {
$ref: '#/definitions/functionOrNull',
},
transform: {
$ref: '#/definitions/functionOrNull',
},
done: {
$ref: '#/definitions/functionOrNull',
},
entrypoints: {
type: 'boolean',
default: false,
},
entrypointsKey: {
default: 'entrypoints',
oneOf: [
{
type: 'string',
},
{
const: false,
},
],
},
entrypointsUseAssets: {
type: 'boolean',
default: false,
},
integrity: {
type: 'boolean',
default: 'a',
},
integrityHashes: {
type: 'array',
items: {
type: 'string',
enum: (0, node_crypto_1.getHashes)(),
},
default: ['sha256', 'sha384', 'sha512'],
},
integrityPropertyName: {
description: 'The `asset.info` property name where the SRI hash is stored',
type: 'string',
minLength: 1,
default: 'integrity',
},
extra: {
description: 'A place to put your arbitrary data',
type: 'object',
default: {},
},
},
definitions: {
functionOrNull: {
default: null,
oneOf: [
{
instanceof: 'Function',
},
{
type: 'null',
},
],
},
},
};