Merge remote-tracking branch 'upstream/main'

This commit is contained in:
2026-08-26 09:31:34 +08:00
parent 9b8c4bfab6
commit 394eb0285d
34137 changed files with 3589424 additions and 0 deletions
@@ -0,0 +1 @@
{"name":"dll","content":{"./dll.js":{"id":1,"meta":{"harmonyModule":true},"exports":["dll"]},"../assets/facebook.svg":{"id":2,"meta":{"harmonyModule":true},"exports":["default"]}}}
@@ -0,0 +1,117 @@
var dll =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__;
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (immutable) */ __webpack_exports__["dll"] = dll;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__ = __webpack_require__(2);
// => {id string, width: string, height: string, viewBox: string, url: string}
console.log(`dll: ${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["default"]}`);
let image;
let usage;
window.addEventListener('DOMContentLoaded', () => {
image = `<img width="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["default"].width}" height="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["default"].height}" src="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["default"].url}">`;
usage = `<svg viewBox="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["default"].viewBox}"><use xlink:href="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["default"].url}"></use></svg>`;
});
function dll() {
console.log('dll module');
document.body.insertAdjacentHTML('beforeend', `${image} ${usage}`);
}
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony default export */ __webpack_exports__["default"] = ({
id: "facebook-usage",
viewBox: "0 0 1000 1000",
url: __webpack_require__.p + "dll.svg#facebook-usage",
toString: function () {
return this.url;
}
});
/***/ })
/******/ ]);
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style>
.sprite-symbol-usage {display: none;}
.sprite-symbol-usage:target {display: inline;}
</style><symbol viewBox="0 0 1000 1000" id="facebook"><path d="M990 500c0-270.6-219.4-490-490-490S10 229.4 10 500s219.4 490 490 490 490-219.4 490-490zm-935.5 0C54.5 254 254 54.5 500 54.5S945.5 254 945.5 500 746.1 945.5 500 945.5C254 945.5 54.5 746 54.5 500z" /><path d="M518.8 782.8V500h93.3l14.7-93.7h-108v-47c0-24.5 8-47.8 43.1-47.8h70.2V218h-99.6c-83.7 0-106.6 55.1-106.6 131.6v56.7h-57.5V500h57.5v282.8h92.9z" /></symbol></defs><use id="facebook-usage" xlink:href="#facebook" class="sprite-symbol-usage" /></svg>

After

Width:  |  Height:  |  Size: 708 B

@@ -0,0 +1,147 @@
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "build/";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assets_twitter_svg__ = __webpack_require__(1);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dll__ = __webpack_require__(2);
// => {id string, width: string, height: string, viewBox: string, url: string}
console.log(`main: ${__WEBPACK_IMPORTED_MODULE_0__assets_twitter_svg__["a" /* default */]}`);
window.addEventListener('DOMContentLoaded', () => {
const image = `<img width="${__WEBPACK_IMPORTED_MODULE_0__assets_twitter_svg__["a" /* default */].width}" height="${__WEBPACK_IMPORTED_MODULE_0__assets_twitter_svg__["a" /* default */].height}" src="${__WEBPACK_IMPORTED_MODULE_0__assets_twitter_svg__["a" /* default */].url}">`;
const usage = `<svg viewBox="${__WEBPACK_IMPORTED_MODULE_0__assets_twitter_svg__["a" /* default */].viewBox}"><use xlink:href="${__WEBPACK_IMPORTED_MODULE_0__assets_twitter_svg__["a" /* default */].url}"></use></svg>`;
document.body.insertAdjacentHTML('beforeend', `${image} ${usage}`);
Object(__WEBPACK_IMPORTED_MODULE_1__dll__["a" /* dll */])();
});
/***/ }),
/* 1 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ({
id: "twitter-usage",
viewBox: "0 0 273.4 222.2",
url: __webpack_require__.p + "sprite.svg#twitter-usage",
toString: function () {
return this.url;
}
});
/***/ }),
/* 2 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony export (immutable) */ __webpack_exports__["a"] = dll;
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__ = __webpack_require__(3);
// => {id string, width: string, height: string, viewBox: string, url: string}
console.log(`dll: ${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["a" /* default */]}`);
let image;
let usage;
window.addEventListener('DOMContentLoaded', () => {
image = `<img width="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["a" /* default */].width}" height="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["a" /* default */].height}" src="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["a" /* default */].url}">`;
usage = `<svg viewBox="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["a" /* default */].viewBox}"><use xlink:href="${__WEBPACK_IMPORTED_MODULE_0__assets_facebook_svg__["a" /* default */].url}"></use></svg>`;
});
function dll() {
console.log('dll module');
document.body.insertAdjacentHTML('beforeend', `${image} ${usage}`);
}
/***/ }),
/* 3 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony default export */ __webpack_exports__["a"] = ({
id: "facebook-usage",
viewBox: "0 0 1000 1000",
url: __webpack_require__.p + "sprite.svg#facebook-usage",
toString: function () {
return this.url;
}
});
/***/ })
/******/ ]);
@@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style>
.sprite-symbol-usage {display: none;}
.sprite-symbol-usage:target {display: inline;}
</style><symbol viewBox="0 0 1000 1000" id="facebook"><path d="M990 500c0-270.6-219.4-490-490-490S10 229.4 10 500s219.4 490 490 490 490-219.4 490-490zm-935.5 0C54.5 254 254 54.5 500 54.5S945.5 254 945.5 500 746.1 945.5 500 945.5C254 945.5 54.5 746 54.5 500z" /><path d="M518.8 782.8V500h93.3l14.7-93.7h-108v-47c0-24.5 8-47.8 43.1-47.8h70.2V218h-99.6c-83.7 0-106.6 55.1-106.6 131.6v56.7h-57.5V500h57.5v282.8h92.9z" /></symbol><symbol viewBox="0 0 273.4 222.2" id="twitter"><path d="M273.4 26.3c-10.1 4.5-20.9 7.5-32.2 8.8 11.6-6.9 20.5-17.9 24.7-31-10.9 6.4-22.9 11.1-35.7 13.6A55.919 55.919 0 0 0 189.3 0c-31 0-56.1 25.1-56.1 56.1 0 4.4.5 8.7 1.5 12.8C88 66.5 46.7 44.2 19 10.3c-4.8 8.3-7.6 17.9-7.6 28.2 0 19.5 9.9 36.6 25 46.7-9.2-.3-17.8-2.8-25.4-7v.7c0 27.2 19.3 49.8 45 55-4.7 1.3-9.7 2-14.8 2-3.6 0-7.1-.4-10.6-1 7.1 22.3 27.9 38.5 52.4 39-19.2 15-43.4 24-69.7 24-4.5 0-9-.3-13.4-.8 24.8 15.9 54.3 25.2 86 25.2 103.2 0 159.6-85.5 159.6-159.6 0-2.4-.1-4.9-.2-7.3 11.1-8 20.6-17.9 28.1-29.1z" /></symbol></defs><use id="facebook-usage" xlink:href="#facebook" class="sprite-symbol-usage" /><use id="twitter-usage" xlink:href="#twitter" class="sprite-symbol-usage" /></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="build/dll.js"></script>
<script src="build/main.js"></script>
</head>
<body>
</body>
</html>
@@ -0,0 +1,18 @@
import symbolData from '../assets/facebook.svg';
// => {id string, width: string, height: string, viewBox: string, url: string}
console.log(`dll: ${symbolData}`);
let image;
let usage;
window.addEventListener('DOMContentLoaded', () => {
image = `<img width="${symbolData.width}" height="${symbolData.height}" src="${symbolData.url}">`;
usage = `<svg viewBox="${symbolData.viewBox}"><use xlink:href="${symbolData.url}"></use></svg>`;
});
export function dll() {
console.log('dll module');
document.body.insertAdjacentHTML('beforeend', `${image} ${usage}`);
}
@@ -0,0 +1,15 @@
import symbolData from '../assets/twitter.svg';
import { dll } from './dll';
// => {id string, width: string, height: string, viewBox: string, url: string}
console.log(`main: ${symbolData}`);
window.addEventListener('DOMContentLoaded', () => {
const image = `<img width="${symbolData.width}" height="${symbolData.height}" src="${symbolData.url}">`;
const usage = `<svg viewBox="${symbolData.viewBox}"><use xlink:href="${symbolData.url}"></use></svg>`;
document.body.insertAdjacentHTML('beforeend', `${image} ${usage}`);
dll();
});
@@ -0,0 +1,39 @@
const path = require('path');
const webpack = require('webpack');
const merge = require('deepmerge');
const baseConfig = require('../base-webpack.config');
const SpritePlugin = require('../../plugin');
module.exports = merge(baseConfig, {
context: __dirname,
entry: './main',
output: {
path: path.resolve(__dirname, 'build'),
publicPath: 'build/'
},
module: {
rules: [
{
test: /\.svg$/,
use: [
{
loader: 'svg-sprite-loader',
options: { extract: true }
},
'svgo-loader'
]
}
]
},
plugins: [
new webpack.DllReferencePlugin({
context: '.',
manifest: require('./build/dll-manifest.json')
}),
new SpritePlugin()
]
});
@@ -0,0 +1,43 @@
const path = require('path');
const merge = require('deepmerge');
const webpack = require('webpack');
const baseConfig = require('../base-webpack.config');
const SpritePlugin = require('../../plugin');
module.exports = merge(baseConfig, {
context: __dirname,
entry: {
dll: ['./dll']
},
output: {
path: path.resolve(__dirname, 'build'),
library: 'dll'
},
module: {
rules: [
{
test: /\.svg$/,
use: [
// 'svg-sprite-loader',
{
loader: 'svg-sprite-loader',
options: { extract: true, spriteFilename: 'dll.svg' }
},
'svgo-loader'
]
}
]
},
plugins: [
new webpack.DllPlugin({
path: path.join(__dirname, 'build', '[name]-manifest.json'),
name: 'dll'
}),
new SpritePlugin()
]
});