更新前端静态网页获取方式,放弃使用后端获取api

This commit is contained in:
2025-09-09 10:47:51 +08:00
parent 6889ca37e5
commit 44a4f1bae1
25558 changed files with 2463152 additions and 153 deletions

20
frontend/node_modules/mini-css-extract-plugin/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,20 @@
Copyright JS Foundation and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

1296
frontend/node_modules/mini-css-extract-plugin/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,110 @@
{
"name": "mini-css-extract-plugin",
"version": "2.9.4",
"description": "extracts CSS into separate files",
"keywords": [
"webpack",
"css",
"extract",
"hmr"
],
"homepage": "https://github.com/webpack-contrib/mini-css-extract-plugin",
"bugs": "https://github.com/webpack-contrib/mini-css-extract-plugin/issues",
"repository": "webpack-contrib/mini-css-extract-plugin",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
},
"license": "MIT",
"author": "Tobias Koppers @sokra",
"main": "dist/index.js",
"types": "types/index.d.ts",
"files": [
"dist",
"types"
],
"scripts": {
"start": "npm run build -- -w",
"prebuild": "npm run clean",
"build:types": "tsc --declaration --emitDeclarationOnly --outDir types && prettier \"types/**/*.ts\" --write",
"build:code": "cross-env NODE_ENV=production babel src -d dist --copy-files",
"build": "npm-run-all -p \"build:**\"",
"clean": "del-cli dist",
"commitlint": "commitlint --from=master",
"lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different",
"lint:code": "eslint --cache .",
"lint:spelling": "cspell \"**/*.*\"",
"lint:types": "tsc --pretty --noEmit",
"lint:es-check": "es-check es5 dist/hmr/hotModuleReplacement.js",
"lint": "npm-run-all -l -p \"lint:**\"",
"fix:code": "npm run lint:code -- --fix",
"fix:prettier": "npm run lint:prettier -- --write",
"fix": "npm-run-all -l fix:code fix:prettier",
"prepare": "husky install && npm run build",
"release": "standard-version",
"security": "npm audit --production",
"test:only": "cross-env NODE_ENV=test jest",
"test:only:experimental": "EXPERIMENTAL_USE_IMPORT_MODULE=true cross-env NODE_ENV=test jest",
"test:watch": "npm run test:only -- --watch",
"test:coverage": "npm run test:only -- --collectCoverageFrom=\"src/**/*.js\" --coverage",
"test:manual": "npm run build && webpack serve ./test/manual/src/index.js --open --config ./test/manual/webpack.config.js",
"pretest": "npm run lint",
"test": "cross-env NODE_ENV=test npm run test:coverage"
},
"dependencies": {
"schema-utils": "^4.0.0",
"tapable": "^2.2.1"
},
"devDependencies": {
"@babel/cli": "^7.24.1",
"@babel/core": "^7.24.4",
"@babel/preset-env": "^7.24.4",
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@eslint/js": "^9.32.0",
"@eslint/markdown": "^7.0.0",
"@stylistic/eslint-plugin": "^5.2.2",
"@types/node": "^18.15.11",
"bootstrap": "^4.6.2",
"cross-env": "^7.0.3",
"cspell": "^6.31.1",
"css-loader": "^6.10.0",
"del": "^6.0.0",
"del-cli": "^4.0.0",
"es-check": "^7.1.0",
"eslint": "^9.32.0",
"eslint-config-prettier": "^10.1.8",
"eslint-config-webpack": "^4.4.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-jsdoc": "^52.0.0",
"eslint-plugin-n": "^17.21.0",
"eslint-plugin-prettier": "^5.5.3",
"eslint-plugin-unicorn": "^60.0.0",
"file-loader": "^6.2.0",
"globals": "^16.3.0",
"husky": "^7.0.0",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"jsdom": "^19.0.0",
"lint-staged": "^13.2.1",
"memfs": "^3.4.13",
"npm-run-all": "^4.1.5",
"prettier": "^3.6.0",
"prettier-2": "npm:prettier@^2",
"sass": "^1.74.1",
"sass-loader": "^12.6.0",
"standard-version": "^9.3.0",
"typescript": "^5.8.0",
"typescript-eslint": "^8.38.0",
"webpack": "^5.91.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^5.2.1"
},
"peerDependencies": {
"webpack": "^5.0.0"
},
"engines": {
"node": ">= 12.13.0"
}
}

View File

@@ -0,0 +1,16 @@
declare namespace _exports {
export { GetScriptSrc, HotHTMLLinkElement };
}
declare function _exports(
moduleId: number | string,
options: {
filename?: string;
locals?: boolean;
},
): () => void;
export = _exports;
type GetScriptSrc = (filename?: string) => string[];
type HotHTMLLinkElement = HTMLLinkElement & {
isLoaded: boolean;
visited: boolean;
};

View File

@@ -0,0 +1,2 @@
declare function _exports(urlString: string): string;
export = _exports;

View File

@@ -0,0 +1,17 @@
export function getCompilationHooks(
compilation: Compilation,
): MiniCssExtractPluginCompilationHooks;
export type Compilation = import("webpack").Compilation;
export type VarNames = {
tag: string;
chunkId: string;
href: string;
resolve: string;
reject: string;
};
export type MiniCssExtractPluginCompilationHooks = {
beforeTagInsert: import("tapable").SyncWaterfallHook<
[string, VarNames],
string
>;
};

View File

@@ -0,0 +1,362 @@
export = MiniCssExtractPlugin;
declare class MiniCssExtractPlugin {
/**
* @param {Compiler["webpack"]} webpack webpack
* @returns {CssModuleConstructor} CSS module constructor
*/
static getCssModule(webpack: Compiler["webpack"]): CssModuleConstructor;
/**
* @param {Compiler["webpack"]} webpack webpack
* @returns {CssDependencyConstructor} CSS dependency constructor
*/
static getCssDependency(
webpack: Compiler["webpack"],
): CssDependencyConstructor;
/**
* Returns all hooks for the given compilation
* @param {Compilation} compilation the compilation
* @returns {MiniCssExtractPluginCompilationHooks} hooks
*/
static getCompilationHooks(
compilation: Compilation,
): MiniCssExtractPluginCompilationHooks;
/**
* @param {PluginOptions=} options options
*/
constructor(options?: PluginOptions | undefined);
/**
* @private
* @type {WeakMap<Chunk, Set<CssModule>>}
*/
private _sortedModulesCache;
/**
* @private
* @type {NormalizedPluginOptions}
*/
private options;
/**
* @private
* @type {RuntimeOptions}
*/
private runtimeOptions;
/**
* @param {Compiler} compiler compiler
*/
apply(compiler: Compiler): void;
/**
* @private
* @param {Chunk} chunk chunk
* @param {ChunkGraph} chunkGraph chunk graph
* @returns {Iterable<Module>} modules
*/
private getChunkModules;
/**
* @private
* @param {Compilation} compilation compilation
* @param {Chunk} chunk chunk
* @param {CssModule[]} modules modules
* @param {Compilation["requestShortener"]} requestShortener request shortener
* @returns {Set<CssModule>} css modules
*/
private sortModules;
/**
* @private
* @param {Compiler} compiler compiler
* @param {Compilation} compilation compilation
* @param {Chunk} chunk chunk
* @param {CssModule[]} modules modules
* @param {Compiler["requestShortener"]} requestShortener request shortener
* @param {string} filenameTemplate filename template
* @param {Parameters<Exclude<Required<Configuration>['output']['filename'], string | undefined>>[0]} pathData path data
* @returns {Source} source
*/
private renderContentAsset;
}
declare namespace MiniCssExtractPlugin {
export {
pluginName,
pluginSymbol,
loader,
Schema,
Compiler,
Compilation,
ChunkGraph,
Chunk,
ChunkGroup,
Module,
Dependency,
Source,
Configuration,
WebpackError,
AssetInfo,
LoaderDependency,
Filename,
ChunkFilename,
LoaderOptions,
PluginOptions,
NormalizedPluginOptions,
RuntimeOptions,
CssModuleDependency,
CssModule,
CssModuleConstructor,
CssDependency,
CssDependencyOptions,
CssDependencyConstructor,
VarNames,
MiniCssExtractPluginCompilationHooks,
};
}
/** @typedef {import("schema-utils/declarations/validate").Schema} Schema */
/** @typedef {import("webpack").Compiler} Compiler */
/** @typedef {import("webpack").Compilation} Compilation */
/** @typedef {import("webpack").ChunkGraph} ChunkGraph */
/** @typedef {import("webpack").Chunk} Chunk */
/** @typedef {import("webpack").ChunkGroup} ChunkGroup */
/** @typedef {import("webpack").Module} Module */
/** @typedef {import("webpack").Dependency} Dependency */
/** @typedef {import("webpack").sources.Source} Source */
/** @typedef {import("webpack").Configuration} Configuration */
/** @typedef {import("webpack").WebpackError} WebpackError */
/** @typedef {import("webpack").AssetInfo} AssetInfo */
/** @typedef {import("./loader.js").Dependency} LoaderDependency */
/** @typedef {NonNullable<Required<Configuration>['output']['filename']>} Filename */
/** @typedef {NonNullable<Required<Configuration>['output']['chunkFilename']>} ChunkFilename */
/**
* @typedef {object} LoaderOptions
* @property {string | ((resourcePath: string, rootContext: string) => string)=} publicPath public path
* @property {boolean=} emit true when need to emit, otherwise false
* @property {boolean=} esModule need to generate ES module syntax
* @property {string=} layer a layer
* @property {boolean=} defaultExport true when need to use default export, otherwise false
*/
/**
* @typedef {object} PluginOptions
* @property {Filename=} filename filename
* @property {ChunkFilename=} chunkFilename chunk filename
* @property {boolean=} ignoreOrder true when need to ignore order, otherwise false
* @property {string | ((linkTag: HTMLLinkElement) => void)=} insert link insert place or a custom insert function
* @property {Record<string, string>=} attributes link attributes
* @property {string | false | 'text/css'=} linkType value of a link type attribute
* @property {boolean=} runtime true when need to generate runtime code, otherwise false
* @property {boolean=} experimentalUseImportModule true when need to use `experimentalUseImportModule` API, otherwise false
*/
/**
* @typedef {object} NormalizedPluginOptions
* @property {Filename} filename filename
* @property {ChunkFilename=} chunkFilename chunk filename
* @property {boolean} ignoreOrder true when need to ignore order, otherwise false
* @property {string | ((linkTag: HTMLLinkElement) => void)=} insert a link insert place or a custom insert function
* @property {Record<string, string>=} attributes link attributes
* @property {string | false | 'text/css'=} linkType value of a link type attribute
* @property {boolean} runtime true when need to generate runtime code, otherwise false
* @property {boolean=} experimentalUseImportModule true when need to use `experimentalUseImportModule` API, otherwise false
*/
/**
* @typedef {object} RuntimeOptions
* @property {string | ((linkTag: HTMLLinkElement) => void)=} insert a link insert place or a custom insert function
* @property {string | false | 'text/css'} linkType value of a link type attribute
* @property {Record<string, string>=} attributes link attributes
*/
declare const pluginName: "mini-css-extract-plugin";
declare const pluginSymbol: unique symbol;
declare var loader: string;
type Schema = import("schema-utils/declarations/validate").Schema;
type Compiler = import("webpack").Compiler;
type Compilation = import("webpack").Compilation;
type ChunkGraph = import("webpack").ChunkGraph;
type Chunk = import("webpack").Chunk;
type ChunkGroup = import("webpack").ChunkGroup;
type Module = import("webpack").Module;
type Dependency = import("webpack").Dependency;
type Source = import("webpack").sources.Source;
type Configuration = import("webpack").Configuration;
type WebpackError = import("webpack").WebpackError;
type AssetInfo = import("webpack").AssetInfo;
type LoaderDependency = import("./loader.js").Dependency;
type Filename = NonNullable<Required<Configuration>["output"]["filename"]>;
type ChunkFilename = NonNullable<
Required<Configuration>["output"]["chunkFilename"]
>;
type LoaderOptions = {
/**
* public path
*/
publicPath?:
| (string | ((resourcePath: string, rootContext: string) => string))
| undefined;
/**
* true when need to emit, otherwise false
*/
emit?: boolean | undefined;
/**
* need to generate ES module syntax
*/
esModule?: boolean | undefined;
/**
* a layer
*/
layer?: string | undefined;
/**
* true when need to use default export, otherwise false
*/
defaultExport?: boolean | undefined;
};
type PluginOptions = {
/**
* filename
*/
filename?: Filename | undefined;
/**
* chunk filename
*/
chunkFilename?: ChunkFilename | undefined;
/**
* true when need to ignore order, otherwise false
*/
ignoreOrder?: boolean | undefined;
/**
* link insert place or a custom insert function
*/
insert?: (string | ((linkTag: HTMLLinkElement) => void)) | undefined;
/**
* link attributes
*/
attributes?: Record<string, string> | undefined;
/**
* value of a link type attribute
*/
linkType?: (string | false | "text/css") | undefined;
/**
* true when need to generate runtime code, otherwise false
*/
runtime?: boolean | undefined;
/**
* true when need to use `experimentalUseImportModule` API, otherwise false
*/
experimentalUseImportModule?: boolean | undefined;
};
type NormalizedPluginOptions = {
/**
* filename
*/
filename: Filename;
/**
* chunk filename
*/
chunkFilename?: ChunkFilename | undefined;
/**
* true when need to ignore order, otherwise false
*/
ignoreOrder: boolean;
/**
* a link insert place or a custom insert function
*/
insert?: (string | ((linkTag: HTMLLinkElement) => void)) | undefined;
/**
* link attributes
*/
attributes?: Record<string, string> | undefined;
/**
* value of a link type attribute
*/
linkType?: (string | false | "text/css") | undefined;
/**
* true when need to generate runtime code, otherwise false
*/
runtime: boolean;
/**
* true when need to use `experimentalUseImportModule` API, otherwise false
*/
experimentalUseImportModule?: boolean | undefined;
};
type RuntimeOptions = {
/**
* a link insert place or a custom insert function
*/
insert?: (string | ((linkTag: HTMLLinkElement) => void)) | undefined;
/**
* value of a link type attribute
*/
linkType: string | false | "text/css";
/**
* link attributes
*/
attributes?: Record<string, string> | undefined;
};
type CssModuleDependency = {
context: string | null;
identifier: string;
identifierIndex: number;
content: Buffer;
sourceMap?: Buffer;
media?: string;
supports?: string;
layer?: any;
assetsInfo?: Map<string, AssetInfo>;
assets?: {
[key: string]: Source;
};
};
type CssModule = Module & {
content: Buffer;
media?: string;
sourceMap?: Buffer;
supports?: string;
layer?: string;
assets?: {
[key: string]: Source;
};
assetsInfo?: Map<string, AssetInfo>;
};
type CssModuleConstructor = {
new (dependency: CssModuleDependency): CssModule;
};
type CssDependency = Dependency & CssModuleDependency;
type CssDependencyOptions = Omit<LoaderDependency, "context">;
type CssDependencyConstructor = {
new (
loaderDependency: CssDependencyOptions,
context: string | null,
identifierIndex: number,
): CssDependency;
};
type VarNames = {
/**
* tag
*/
tag: string;
/**
* chunk id
*/
chunkId: string;
/**
* href
*/
href: string;
/**
* resolve
*/
resolve: string;
/**
* reject
*/
reject: string;
};
type MiniCssExtractPluginCompilationHooks = {
/**
* before tag insert hook
*/
beforeTagInsert: import("tapable").SyncWaterfallHook<
[string, VarNames],
string
>;
/**
* link preload hook
*/
linkPreload: SyncWaterfallHook<[string, Chunk]>;
/**
* link prefetch hook
*/
linkPrefetch: SyncWaterfallHook<[string, Chunk]>;
};
import { SyncWaterfallHook } from "tapable";

View File

@@ -0,0 +1,114 @@
export = loader;
/**
* @this {import("webpack").LoaderContext<LoaderOptions>}
* @param {string} content content
* @returns {string | undefined} the original content
*/
declare function loader(
this: import("webpack").LoaderContext<MiniCssExtractPlugin.LoaderOptions>,
content: string,
): string | undefined;
declare namespace loader {
export {
hotLoader,
pitch,
Schema,
Compiler,
Compilation,
Chunk,
Module,
Source,
AssetInfo,
NormalModule,
LoaderOptions,
Locals,
EXPECTED_ANY,
Dependency,
};
}
import MiniCssExtractPlugin = require("./index");
/** @typedef {import("schema-utils/declarations/validate").Schema} Schema */
/** @typedef {import("webpack").Compiler} Compiler */
/** @typedef {import("webpack").Compilation} Compilation */
/** @typedef {import("webpack").Chunk} Chunk */
/** @typedef {import("webpack").Module} Module */
/** @typedef {import("webpack").sources.Source} Source */
/** @typedef {import("webpack").AssetInfo} AssetInfo */
/** @typedef {import("webpack").NormalModule} NormalModule */
/** @typedef {import("./index.js").LoaderOptions} LoaderOptions */
/** @typedef {{[key: string]: string | Function }} Locals */
/** @typedef {any} EXPECTED_ANY */
/**
* @typedef {object} Dependency
* @property {string} identifier identifier
* @property {string | null} context context
* @property {Buffer} content content
* @property {string=} media media
* @property {string=} supports supports
* @property {string=} layer layer
* @property {Buffer=} sourceMap source map
*/
/**
* @param {string} code code
* @param {{ loaderContext: import("webpack").LoaderContext<LoaderOptions>, options: LoaderOptions, locals: Locals | undefined }} context context
* @returns {string} code and HMR code
*/
declare function hotLoader(
code: string,
context: {
loaderContext: import("webpack").LoaderContext<LoaderOptions>;
options: LoaderOptions;
locals: Locals | undefined;
},
): string;
/**
* @this {import("webpack").LoaderContext<LoaderOptions>}
* @param {string} request request
*/
declare function pitch(
this: import("webpack").LoaderContext<MiniCssExtractPlugin.LoaderOptions>,
request: string,
): void;
type Schema = import("schema-utils/declarations/validate").Schema;
type Compiler = import("webpack").Compiler;
type Compilation = import("webpack").Compilation;
type Chunk = import("webpack").Chunk;
type Module = import("webpack").Module;
type Source = import("webpack").sources.Source;
type AssetInfo = import("webpack").AssetInfo;
type NormalModule = import("webpack").NormalModule;
type LoaderOptions = import("./index.js").LoaderOptions;
type Locals = {
[key: string]: string | Function;
};
type EXPECTED_ANY = any;
type Dependency = {
/**
* identifier
*/
identifier: string;
/**
* context
*/
context: string | null;
/**
* content
*/
content: Buffer;
/**
* media
*/
media?: string | undefined;
/**
* supports
*/
supports?: string | undefined;
/**
* layer
*/
layer?: string | undefined;
/**
* source map
*/
sourceMap?: Buffer | undefined;
};

View File

@@ -0,0 +1,73 @@
export type Compilation = import("webpack").Compilation;
export type Module = import("webpack").Module;
export type LoaderContext = import("webpack").LoaderContext<any>;
export const ABSOLUTE_PUBLIC_PATH: "webpack:///mini-css-extract-plugin/";
export const AUTO_PUBLIC_PATH: "__mini_css_extract_plugin_public_path_auto__";
export const BASE_URI: "webpack://";
export const MODULE_TYPE: "css/mini-extract";
export const SINGLE_DOT_PATH_SEGMENT: "__mini_css_extract_plugin_single_dot_path_segment__";
/**
* @param {Module} a a
* @param {Module} b b
* @returns {0 | 1 | -1} result of comparing
*/
export function compareModulesByIdentifier(a: Module, b: Module): 0 | 1 | -1;
/**
* @param {Record<string | number, boolean>} map value map
* @returns {boolean | ((value: string) => string)} true/false, when unconditionally true/false, or a template function to determine the value at runtime
*/
export function compileBooleanMatcher(
map: Record<string | number, boolean>,
): boolean | ((value: string) => string);
/**
* @param {LoaderContext} loaderContext loader context
* @param {string | Buffer} code code
* @param {string} filename filename
* @returns {Record<string, any>} exports of a module
*/
export function evalModuleCode(
loaderContext: LoaderContext,
code: string | Buffer,
filename: string,
): Record<string, any>;
/**
* @param {Compilation} compilation compilation
* @param {string | number} id module id
* @returns {null | Module} the found module
*/
export function findModuleById(
compilation: Compilation,
id: string | number,
): null | Module;
/**
* @param {string} filename filename
* @param {string} outputPath output path
* @param {boolean} enforceRelative true when need to enforce relative path, otherwise false
* @returns {string} undo path
*/
export function getUndoPath(
filename: string,
outputPath: string,
enforceRelative: boolean,
): string;
/**
* @param {string | Function} value local
* @returns {string} stringified local
*/
export function stringifyLocal(value: string | Function): string;
/**
* @param {LoaderContext} loaderContext the loader context
* @param {string} request a request
* @returns {string} a stringified request
*/
export function stringifyRequest(
loaderContext: LoaderContext,
request: string,
): string;
/** @typedef {import("webpack").Compilation} Compilation */
/** @typedef {import("webpack").Module} Module */
/** @typedef {import("webpack").LoaderContext<any>} LoaderContext */
/**
* @returns {boolean} always returns true
*/
export function trueFn(): boolean;