@unpackjs/core 1.7.5 → 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/css-loader/index.js +180 -178
- package/compiled/less-loader/index.js +11 -11
- package/compiled/line-diff/index.js +4 -4
- package/compiled/line-diff/license +1 -1
- package/compiled/line-diff/package.json +1 -1
- package/compiled/portfinder/index.js +37 -37
- package/compiled/postcss-loader/index.js +261 -256
- package/compiled/sass-loader/index.js +24 -20
- package/compiled/sass-loader/package.json +1 -1
- package/compiled/semver/index.js +188 -170
- package/compiled/semver/package.json +1 -1
- package/compiled/style-loader/index.js +13 -13
- package/compiled/webpack-bundle-analyzer/index.js +198 -198
- package/compiled/webpack-merge/index.js +29 -29
- package/dist/bundler-config/chunkSplit.cjs +169 -156
- package/dist/bundler-config/chunkSplit.js +125 -134
- package/dist/bundler-config/css.cjs +181 -158
- package/dist/bundler-config/css.js +139 -151
- package/dist/bundler-config/experimentCss.cjs +203 -159
- package/dist/bundler-config/experimentCss.js +162 -152
- package/dist/bundler-config/helper.cjs +82 -78
- package/dist/bundler-config/helper.js +36 -55
- package/dist/bundler-config/index.cjs +260 -209
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +209 -182
- package/dist/bundler-config/jsMinify.cjs +114 -95
- package/dist/bundler-config/jsMinify.js +70 -73
- package/dist/colors.cjs +83 -56
- package/dist/colors.js +38 -37
- package/dist/config.cjs +107 -93
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +64 -70
- package/dist/constants.cjs +65 -62
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +22 -38
- package/dist/createUnpack.cjs +111 -104
- package/dist/createUnpack.js +67 -82
- package/dist/global.cjs +36 -0
- package/dist/global.d.ts +2 -0
- package/dist/global.d.ts.map +1 -0
- package/dist/global.js +4 -0
- package/dist/index.cjs +174 -51
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -15
- package/dist/lightningcss/loader.cjs +56 -53
- package/dist/lightningcss/loader.d.ts.map +1 -1
- package/dist/lightningcss/loader.js +25 -34
- package/dist/lightningcss/minimizer.cjs +90 -109
- package/dist/lightningcss/minimizer.d.ts.map +1 -1
- package/dist/lightningcss/minimizer.js +59 -87
- package/dist/logger.cjs +104 -98
- package/dist/logger.js +59 -76
- package/dist/openBrowser.cjs +104 -81
- package/dist/openBrowser.js +56 -52
- package/dist/plugin-progress/rspack.cjs +104 -79
- package/dist/plugin-progress/rspack.js +59 -57
- package/dist/plugin-progress/webpack.cjs +111 -89
- package/dist/plugin-progress/webpack.js +65 -67
- package/dist/plugin.cjs +38 -29
- package/dist/plugin.js +8 -17
- package/dist/prebundleDeps.cjs +327 -337
- package/dist/prebundleDeps.d.ts.map +1 -1
- package/dist/prebundleDeps.js +278 -324
- package/dist/progressBar.cjs +82 -65
- package/dist/progressBar.js +38 -43
- package/dist/reporter.cjs +149 -124
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +102 -102
- package/dist/run/build.cjs +68 -67
- package/dist/run/build.js +24 -45
- package/dist/run/dev.cjs +96 -83
- package/dist/run/dev.d.ts.map +1 -1
- package/dist/run/dev.js +50 -61
- package/dist/run/index.cjs +74 -21
- package/dist/run/index.js +2 -9
- package/dist/typed-css-modules/loader.cjs +179 -188
- package/dist/typed-css-modules/loader.js +118 -151
- package/dist/typed-css-modules/plugin.cjs +113 -88
- package/dist/typed-css-modules/plugin.js +68 -66
- package/dist/typed-css-modules/utils.cjs +43 -42
- package/dist/typed-css-modules/utils.js +13 -30
- package/dist/types/chunkSplit.cjs +19 -15
- package/dist/types/chunkSplit.d.ts +2 -10
- package/dist/types/chunkSplit.d.ts.map +1 -1
- package/dist/types/chunkSplit.js +2 -9
- package/dist/types/config.cjs +19 -15
- package/dist/types/config.js +2 -9
- package/dist/types/index.cjs +101 -27
- package/dist/types/index.js +2 -9
- package/dist/types/lightningcss.cjs +19 -15
- package/dist/types/lightningcss.js +2 -9
- package/dist/types/logger.cjs +43 -34
- package/dist/types/logger.js +13 -22
- package/dist/types/plugin.cjs +19 -15
- package/dist/types/plugin.js +2 -9
- package/dist/utils.cjs +280 -304
- package/dist/utils.js +195 -241
- package/dist/watchFiles.cjs +73 -0
- package/dist/watchFiles.d.ts +3 -0
- package/dist/watchFiles.d.ts.map +1 -0
- package/dist/watchFiles.js +27 -0
- package/package.json +18 -21
- package/compiled/commander/index.d.ts +0 -1047
- package/compiled/commander/index.js +0 -2428
- package/compiled/commander/license +0 -22
- package/compiled/commander/package.json +0 -1
- package/dist/bundleRequire.cjs +0 -200
- package/dist/bundleRequire.d.ts +0 -5
- package/dist/bundleRequire.d.ts.map +0 -1
- package/dist/bundleRequire.js +0 -173
- package/dist/lightningcss/cache.cjs +0 -36
- package/dist/lightningcss/cache.d.ts +0 -2
- package/dist/lightningcss/cache.d.ts.map +0 -1
- package/dist/lightningcss/cache.js +0 -22
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import { isProd, prettyTime } from "../utils.js";
|
|
17
|
-
const PLUGIN_NAME = "PluginProgress";
|
|
18
|
-
class RspackPluginProgress extends rspack.ProgressPlugin {
|
|
19
|
-
constructor() {
|
|
20
|
-
super((percentage, msg, ...args) => {
|
|
21
|
-
isProd() && this.progressBar.update({ current: percentage, message: `${msg} ${args.join(" ")}` });
|
|
1
|
+
import __rslib_shim_module__ from 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__ from "@rspack/core";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__ from "../colors.js";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__ from "../logger.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__progressBar_js_33ae8bb3__ from "../progressBar.js";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__reporter_js_32fd284b__ from "../reporter.js";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__ from "../utils.js";
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
12
|
+
value: value,
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true
|
|
22
16
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
compiler
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
17
|
+
else obj[key] = value;
|
|
18
|
+
return obj;
|
|
19
|
+
}
|
|
20
|
+
const PLUGIN_NAME = 'PluginProgress';
|
|
21
|
+
class RspackPluginProgress extends __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack.ProgressPlugin {
|
|
22
|
+
apply(compiler) {
|
|
23
|
+
super.apply(compiler);
|
|
24
|
+
compiler.hooks.compile.tap(PLUGIN_NAME, ()=>{
|
|
25
|
+
this.startTime = process.hrtime();
|
|
26
|
+
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isProd)() || __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.wait('building...');
|
|
27
|
+
});
|
|
28
|
+
compiler.hooks.done.tap(PLUGIN_NAME, async (stats)=>{
|
|
29
|
+
if (!this.startTime) return;
|
|
30
|
+
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isProd)() && this.progressBar.done();
|
|
31
|
+
const hrtime = process.hrtime(this.startTime);
|
|
32
|
+
const compileTime = hrtime[0] + hrtime[1] / 1e9;
|
|
33
|
+
this.startTime = void 0;
|
|
34
|
+
const root = compiler.options.context;
|
|
35
|
+
if (!stats.hasErrors()) {
|
|
36
|
+
if ((0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isProd)()) {
|
|
37
|
+
await (0, __WEBPACK_EXTERNAL_MODULE__reporter_js_32fd284b__.printFileSize)({
|
|
38
|
+
root,
|
|
39
|
+
stats
|
|
40
|
+
});
|
|
41
|
+
console.log(__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].green(`✓ built in ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].bold((0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.prettyTime)(compileTime))}`));
|
|
42
|
+
} else {
|
|
43
|
+
const modules = stats.compilation.modules;
|
|
44
|
+
modules.forEach((module)=>{
|
|
45
|
+
const { resource } = module;
|
|
46
|
+
if (null == resource ? void 0 : resource.includes(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(root, 'node_modules'))) __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.debug(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].relative(root, resource));
|
|
47
|
+
});
|
|
48
|
+
__WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.ready(`built in ${(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.prettyTime)(compileTime)} (${modules.size} modules)`);
|
|
49
|
+
}
|
|
50
50
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
constructor(){
|
|
54
|
+
super((percentage, msg, ...args)=>{
|
|
55
|
+
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isProd)() && this.progressBar.update({
|
|
56
|
+
current: percentage,
|
|
57
|
+
message: `${msg} ${args.join(' ')}`
|
|
58
|
+
});
|
|
59
|
+
}), _define_property(this, "startTime", void 0), _define_property(this, "progressBar", new __WEBPACK_EXTERNAL_MODULE__progressBar_js_33ae8bb3__.ProgressBar());
|
|
60
|
+
}
|
|
57
61
|
}
|
|
58
|
-
export {
|
|
59
|
-
RspackPluginProgress
|
|
60
|
-
};
|
|
62
|
+
export { RspackPluginProgress };
|
|
@@ -1,94 +1,116 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
var webpack_exports = {};
|
|
29
|
-
__export(webpack_exports, {
|
|
30
|
-
WebpackPluginProgress: () => WebpackPluginProgress
|
|
31
|
-
});
|
|
32
|
-
module.exports = __toCommonJS(webpack_exports);
|
|
33
|
-
var import_node_path = __toESM(require("node:path"));
|
|
34
|
-
var import_colors = __toESM(require("../colors.cjs"));
|
|
35
|
-
var import_logger = require("../logger.cjs");
|
|
36
|
-
var import_progressBar = require("../progressBar.cjs");
|
|
37
|
-
var import_reporter = require("../reporter.cjs");
|
|
38
|
-
var import_utils = require("../utils.cjs");
|
|
39
|
-
var import_webpack = __toESM(require("webpack"));
|
|
40
|
-
const PLUGIN_NAME = "PluginProgress";
|
|
41
|
-
class WebpackPluginProgress extends import_webpack.default.ProgressPlugin {
|
|
42
|
-
constructor() {
|
|
43
|
-
super({
|
|
44
|
-
entries: false,
|
|
45
|
-
dependencies: false,
|
|
46
|
-
activeModules: true,
|
|
47
|
-
handler: (0, import_utils.isProd)() ? (percentage, msg, ...args) => {
|
|
48
|
-
if (!this.startTime)
|
|
49
|
-
return;
|
|
50
|
-
this.progressBar.update({
|
|
51
|
-
current: percentage,
|
|
52
|
-
message: `${msg} ${args.join(" ").replace(/(\d+) active /, "")}`
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = function(module) {
|
|
5
|
+
var getter = module && module.__esModule ? function() {
|
|
6
|
+
return module['default'];
|
|
7
|
+
} : function() {
|
|
8
|
+
return module;
|
|
9
|
+
};
|
|
10
|
+
__webpack_require__.d(getter, {
|
|
11
|
+
a: getter
|
|
53
12
|
});
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
13
|
+
return getter;
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
18
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: definition[key]
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = function(obj, prop) {
|
|
26
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
27
|
+
};
|
|
28
|
+
})();
|
|
29
|
+
(()=>{
|
|
30
|
+
__webpack_require__.r = function(exports1) {
|
|
31
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
32
|
+
value: 'Module'
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
35
|
+
value: true
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
var __webpack_exports__ = {};
|
|
40
|
+
__webpack_require__.r(__webpack_exports__);
|
|
41
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
42
|
+
WebpackPluginProgress: ()=>WebpackPluginProgress
|
|
43
|
+
});
|
|
44
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
45
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
46
|
+
const external_colors_cjs_namespaceObject = require("../colors.cjs");
|
|
47
|
+
var external_colors_cjs_default = /*#__PURE__*/ __webpack_require__.n(external_colors_cjs_namespaceObject);
|
|
48
|
+
const external_logger_cjs_namespaceObject = require("../logger.cjs");
|
|
49
|
+
const external_progressBar_cjs_namespaceObject = require("../progressBar.cjs");
|
|
50
|
+
const external_reporter_cjs_namespaceObject = require("../reporter.cjs");
|
|
51
|
+
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
52
|
+
const external_webpack_namespaceObject = require("webpack");
|
|
53
|
+
var external_webpack_default = /*#__PURE__*/ __webpack_require__.n(external_webpack_namespaceObject);
|
|
54
|
+
function _define_property(obj, key, value) {
|
|
55
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
56
|
+
value: value,
|
|
57
|
+
enumerable: true,
|
|
58
|
+
configurable: true,
|
|
59
|
+
writable: true
|
|
64
60
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
61
|
+
else obj[key] = value;
|
|
62
|
+
return obj;
|
|
63
|
+
}
|
|
64
|
+
const PLUGIN_NAME = 'PluginProgress';
|
|
65
|
+
class WebpackPluginProgress extends external_webpack_default().ProgressPlugin {
|
|
66
|
+
apply(compiler) {
|
|
67
|
+
super.apply(compiler);
|
|
68
|
+
compiler.hooks.compile.tap(PLUGIN_NAME, ()=>{
|
|
69
|
+
this.startTime = process.hrtime();
|
|
70
|
+
(0, external_utils_cjs_namespaceObject.isProd)() || external_logger_cjs_namespaceObject.logger.wait('building...');
|
|
71
|
+
});
|
|
72
|
+
compiler.hooks.done.tap(PLUGIN_NAME, async (stats)=>{
|
|
73
|
+
if (!this.startTime) return;
|
|
74
|
+
(0, external_utils_cjs_namespaceObject.isProd)() && this.progressBar.done();
|
|
75
|
+
const hrtime = process.hrtime(this.startTime);
|
|
76
|
+
const compileTime = hrtime[0] + hrtime[1] / 1e9;
|
|
77
|
+
this.startTime = void 0;
|
|
78
|
+
const root = compiler.options.context;
|
|
79
|
+
if (!stats.hasErrors()) {
|
|
80
|
+
if ((0, external_utils_cjs_namespaceObject.isProd)()) {
|
|
81
|
+
await (0, external_reporter_cjs_namespaceObject.printFileSize)({
|
|
82
|
+
root,
|
|
83
|
+
stats
|
|
84
|
+
});
|
|
85
|
+
console.log(external_colors_cjs_default().green(`✓ built in ${external_colors_cjs_default().bold((0, external_utils_cjs_namespaceObject.prettyTime)(compileTime))}`));
|
|
86
|
+
} else {
|
|
87
|
+
const modules = stats.compilation.modules;
|
|
88
|
+
modules.forEach((module)=>{
|
|
89
|
+
const { resource } = module;
|
|
90
|
+
if (null == resource ? void 0 : resource.includes(external_node_path_default().resolve(root, 'node_modules'))) external_logger_cjs_namespaceObject.logger.debug(external_node_path_default().relative(root, resource));
|
|
91
|
+
});
|
|
92
|
+
external_logger_cjs_namespaceObject.logger.ready(`built in ${(0, external_utils_cjs_namespaceObject.prettyTime)(compileTime)} (${modules.size} modules)`);
|
|
93
|
+
}
|
|
83
94
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
constructor(){
|
|
98
|
+
super({
|
|
99
|
+
entries: false,
|
|
100
|
+
dependencies: false,
|
|
101
|
+
activeModules: true,
|
|
102
|
+
handler: (0, external_utils_cjs_namespaceObject.isProd)() ? (percentage, msg, ...args)=>{
|
|
103
|
+
if (!this.startTime) return;
|
|
104
|
+
this.progressBar.update({
|
|
105
|
+
current: percentage,
|
|
106
|
+
message: `${msg} ${args.join(' ').replace(/(\d+) active /, '')}`
|
|
107
|
+
});
|
|
108
|
+
} : void 0
|
|
109
|
+
}), _define_property(this, "startTime", void 0), _define_property(this, "progressBar", new external_progressBar_cjs_namespaceObject.ProgressBar());
|
|
110
|
+
}
|
|
90
111
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
112
|
+
var __webpack_export_target__ = exports;
|
|
113
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
114
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
115
|
+
value: true
|
|
94
116
|
});
|
|
@@ -1,70 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import webpack from "webpack";
|
|
17
|
-
const PLUGIN_NAME = "PluginProgress";
|
|
18
|
-
class WebpackPluginProgress extends webpack.ProgressPlugin {
|
|
19
|
-
constructor() {
|
|
20
|
-
super({
|
|
21
|
-
entries: false,
|
|
22
|
-
dependencies: false,
|
|
23
|
-
activeModules: true,
|
|
24
|
-
handler: isProd() ? (percentage, msg, ...args) => {
|
|
25
|
-
if (!this.startTime)
|
|
26
|
-
return;
|
|
27
|
-
this.progressBar.update({
|
|
28
|
-
current: percentage,
|
|
29
|
-
message: `${msg} ${args.join(" ").replace(/(\d+) active /, "")}`
|
|
30
|
-
});
|
|
31
|
-
} : void 0
|
|
32
|
-
});
|
|
33
|
-
this.startTime = void 0;
|
|
34
|
-
this.progressBar = new ProgressBar();
|
|
35
|
-
}
|
|
36
|
-
apply(compiler) {
|
|
37
|
-
super.apply(compiler);
|
|
38
|
-
compiler.hooks.compile.tap(PLUGIN_NAME, () => {
|
|
39
|
-
this.startTime = process.hrtime();
|
|
40
|
-
!isProd() && logger.wait("building...");
|
|
1
|
+
import __rslib_shim_module__ from 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__ from "../colors.js";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__ from "../logger.js";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__progressBar_js_33ae8bb3__ from "../progressBar.js";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__reporter_js_32fd284b__ from "../reporter.js";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__ from "../utils.js";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE_webpack__ from "webpack";
|
|
10
|
+
function _define_property(obj, key, value) {
|
|
11
|
+
if (key in obj) Object.defineProperty(obj, key, {
|
|
12
|
+
value: value,
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true
|
|
41
16
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
17
|
+
else obj[key] = value;
|
|
18
|
+
return obj;
|
|
19
|
+
}
|
|
20
|
+
const PLUGIN_NAME = 'PluginProgress';
|
|
21
|
+
class WebpackPluginProgress extends __WEBPACK_EXTERNAL_MODULE_webpack__["default"].ProgressPlugin {
|
|
22
|
+
apply(compiler) {
|
|
23
|
+
super.apply(compiler);
|
|
24
|
+
compiler.hooks.compile.tap(PLUGIN_NAME, ()=>{
|
|
25
|
+
this.startTime = process.hrtime();
|
|
26
|
+
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isProd)() || __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.wait('building...');
|
|
27
|
+
});
|
|
28
|
+
compiler.hooks.done.tap(PLUGIN_NAME, async (stats)=>{
|
|
29
|
+
if (!this.startTime) return;
|
|
30
|
+
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isProd)() && this.progressBar.done();
|
|
31
|
+
const hrtime = process.hrtime(this.startTime);
|
|
32
|
+
const compileTime = hrtime[0] + hrtime[1] / 1e9;
|
|
33
|
+
this.startTime = void 0;
|
|
34
|
+
const root = compiler.options.context;
|
|
35
|
+
if (!stats.hasErrors()) {
|
|
36
|
+
if ((0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isProd)()) {
|
|
37
|
+
await (0, __WEBPACK_EXTERNAL_MODULE__reporter_js_32fd284b__.printFileSize)({
|
|
38
|
+
root,
|
|
39
|
+
stats
|
|
40
|
+
});
|
|
41
|
+
console.log(__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].green(`✓ built in ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].bold((0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.prettyTime)(compileTime))}`));
|
|
42
|
+
} else {
|
|
43
|
+
const modules = stats.compilation.modules;
|
|
44
|
+
modules.forEach((module)=>{
|
|
45
|
+
const { resource } = module;
|
|
46
|
+
if (null == resource ? void 0 : resource.includes(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(root, 'node_modules'))) __WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.debug(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].relative(root, resource));
|
|
47
|
+
});
|
|
48
|
+
__WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.ready(`built in ${(0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.prettyTime)(compileTime)} (${modules.size} modules)`);
|
|
49
|
+
}
|
|
60
50
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
constructor(){
|
|
54
|
+
super({
|
|
55
|
+
entries: false,
|
|
56
|
+
dependencies: false,
|
|
57
|
+
activeModules: true,
|
|
58
|
+
handler: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isProd)() ? (percentage, msg, ...args)=>{
|
|
59
|
+
if (!this.startTime) return;
|
|
60
|
+
this.progressBar.update({
|
|
61
|
+
current: percentage,
|
|
62
|
+
message: `${msg} ${args.join(' ').replace(/(\d+) active /, '')}`
|
|
63
|
+
});
|
|
64
|
+
} : void 0
|
|
65
|
+
}), _define_property(this, "startTime", void 0), _define_property(this, "progressBar", new __WEBPACK_EXTERNAL_MODULE__progressBar_js_33ae8bb3__.ProgressBar());
|
|
66
|
+
}
|
|
67
67
|
}
|
|
68
|
-
export {
|
|
69
|
-
WebpackPluginProgress
|
|
70
|
-
};
|
|
68
|
+
export { WebpackPluginProgress };
|
package/dist/plugin.cjs
CHANGED
|
@@ -1,33 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = function(exports1, definition) {
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = function(obj, prop) {
|
|
13
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
(()=>{
|
|
17
|
+
__webpack_require__.r = function(exports1) {
|
|
18
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
19
|
+
value: 'Module'
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
22
|
+
value: true
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
var __webpack_exports__ = {};
|
|
27
|
+
__webpack_require__.r(__webpack_exports__);
|
|
28
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
29
|
+
getNormalizedPluginsByHook: ()=>getNormalizedPluginsByHook
|
|
21
30
|
});
|
|
22
|
-
module.exports = __toCommonJS(plugin_exports);
|
|
23
31
|
function getNormalizedPluginsByHook(hook, plugins) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
const pluginMap = new Map();
|
|
33
|
+
null == plugins || plugins.forEach((plugin)=>{
|
|
34
|
+
plugin[hook] && pluginMap.set(plugin.name, plugin);
|
|
35
|
+
});
|
|
36
|
+
return Array.from(pluginMap.values());
|
|
29
37
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
var __webpack_export_target__ = exports;
|
|
39
|
+
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
40
|
+
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
|
|
41
|
+
value: true
|
|
33
42
|
});
|
package/dist/plugin.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import path from "path";
|
|
5
|
-
import { fileURLToPath } from "url";
|
|
6
|
-
var getFilename = () => fileURLToPath(import.meta.url);
|
|
7
|
-
var getDirname = () => path.dirname(getFilename());
|
|
8
|
-
var __dirname = /* @__PURE__ */ getDirname();
|
|
9
|
-
var __filename = /* @__PURE__ */ getFilename();
|
|
1
|
+
import __rslib_shim_module__ from 'module';
|
|
2
|
+
/*#__PURE__*/ import.meta.url;
|
|
10
3
|
function getNormalizedPluginsByHook(hook, plugins) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
const pluginMap = new Map();
|
|
5
|
+
null == plugins || plugins.forEach((plugin)=>{
|
|
6
|
+
plugin[hook] && pluginMap.set(plugin.name, plugin);
|
|
7
|
+
});
|
|
8
|
+
return Array.from(pluginMap.values());
|
|
16
9
|
}
|
|
17
|
-
export {
|
|
18
|
-
getNormalizedPluginsByHook
|
|
19
|
-
};
|
|
10
|
+
export { getNormalizedPluginsByHook };
|