first commit

This commit is contained in:
jefferyzhao
2025-07-31 17:44:12 +08:00
commit b9bdc8598b
42390 changed files with 4467935 additions and 0 deletions

6
node_modules/url-loader/dist/cjs.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
"use strict";
const loader = require('./index');
module.exports = loader.default;
module.exports.raw = loader.raw;

81
node_modules/url-loader/dist/index.js generated vendored Normal file
View File

@ -0,0 +1,81 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = loader;
exports.raw = void 0;
var _loaderUtils = require("loader-utils");
var _schemaUtils = _interopRequireDefault(require("schema-utils"));
var _mime = _interopRequireDefault(require("mime"));
var _normalizeFallback = _interopRequireDefault(require("./utils/normalizeFallback"));
var _options = _interopRequireDefault(require("./options.json"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* eslint-disable
global-require,
no-param-reassign,
prefer-destructuring,
import/no-dynamic-require,
*/
function shouldTransform(limit, size) {
if (typeof limit === 'boolean') {
return limit;
}
if (typeof limit === 'string') {
return size <= parseInt(limit, 10);
}
if (typeof limit === 'number') {
return size <= limit;
}
return true;
}
function loader(src) {
// Loader Options
const options = (0, _loaderUtils.getOptions)(this) || {};
(0, _schemaUtils.default)(_options.default, options, {
name: 'URL Loader',
baseDataPath: 'options'
}); // No limit or within the specified limit
if (shouldTransform(options.limit, src.length)) {
const file = this.resourcePath; // Get MIME type
const mimetype = options.mimetype || _mime.default.getType(file);
if (typeof src === 'string') {
src = Buffer.from(src);
}
return `${options.esModules ? 'export default' : 'module.exports ='} ${JSON.stringify(`data:${mimetype || ''};base64,${src.toString('base64')}`)}`;
} // Normalize the fallback.
const {
loader: fallbackLoader,
options: fallbackOptions
} = (0, _normalizeFallback.default)(options.fallback, options); // Require the fallback.
const fallback = require(fallbackLoader); // Call the fallback, passing a copy of the loader context. The copy has the query replaced. This way, the fallback
// loader receives the query which was intended for it instead of the query which was intended for url-loader.
const fallbackLoaderContext = Object.assign({}, this, {
query: fallbackOptions
});
return fallback.call(fallbackLoaderContext, src);
} // Loader Mode
const raw = true;
exports.raw = raw;

46
node_modules/url-loader/dist/options.json generated vendored Normal file
View File

@ -0,0 +1,46 @@
{
"type": "object",
"properties": {
"limit": {
"description": "Enables/Disables transformation target file into base64 URIs (https://github.com/webpack-contrib/url-loader#limit).",
"type": ["boolean", "number", "string"]
},
"mimetype": {
"description": "The MIME type for the file to be transformed (https://github.com/webpack-contrib/url-loader#mimetype).",
"type": "string"
},
"fallback": {
"description": "An alternative loader to use when a target file's size exceeds the limit set in the limit option (https://github.com/webpack-contrib/url-loader#fallback).",
"anyOf": [
{
"type": "string"
},
{
"additionalProperties": false,
"properties": {
"loader": {
"description": "Fallback loader name.",
"type": "string"
},
"options": {
"description": "Fallback loader options.",
"anyOf": [
{
"type": "object"
},
{
"type": "string"
}
]
}
},
"type": "object"
}
]
},
"esModules": {
"type": "boolean"
}
},
"additionalProperties": true
}

View File

@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = normalizeFallback;
var _loaderUtils = _interopRequireDefault(require("loader-utils"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function normalizeFallback(fallback, originalOptions) {
let loader = 'file-loader';
let options = {};
if (typeof fallback === 'string') {
loader = fallback;
const index = fallback.indexOf('?');
if (index >= 0) {
loader = fallback.substr(0, index);
options = _loaderUtils.default.parseQuery(fallback.substr(index));
}
}
if (fallback !== null && typeof fallback === 'object') {
({
loader,
options
} = fallback);
}
options = Object.assign({}, originalOptions, options);
delete options.fallback;
return {
loader,
options
};
}