@unpackjs/core 3.2.7 → 3.3.1

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.
Files changed (32) hide show
  1. package/compiled/css-loader/index.js +20 -20
  2. package/compiled/less-loader/index.js +8 -8
  3. package/compiled/postcss-loader/index.js +8 -8
  4. package/compiled/sass-loader/index.js +8 -8
  5. package/dist/index.cjs +271 -233
  6. package/dist/index.js +269 -236
  7. package/dist/typedCssModulesLoader.mjs +5 -13
  8. package/dist-types/bundler-config/index.d.ts.map +1 -1
  9. package/dist-types/bundler-config/plugins/oxlint/index.d.ts +0 -3
  10. package/dist-types/bundler-config/plugins/oxlint/index.d.ts.map +1 -1
  11. package/dist-types/bundler-config/plugins/progress/helpers.d.ts +0 -1
  12. package/dist-types/bundler-config/plugins/progress/helpers.d.ts.map +1 -1
  13. package/dist-types/bundler-config/plugins/progress/index.d.ts.map +1 -1
  14. package/dist-types/cliShortcuts.d.ts +22 -0
  15. package/dist-types/cliShortcuts.d.ts.map +1 -0
  16. package/dist-types/config.d.ts.map +1 -1
  17. package/dist-types/createUnpack.d.ts.map +1 -1
  18. package/dist-types/global.d.ts +7 -1
  19. package/dist-types/global.d.ts.map +1 -1
  20. package/dist-types/index.d.ts +1 -0
  21. package/dist-types/index.d.ts.map +1 -1
  22. package/dist-types/logger.d.ts.map +1 -1
  23. package/dist-types/prebundleDeps.d.ts.map +1 -1
  24. package/dist-types/run/dev.d.ts.map +1 -1
  25. package/dist-types/types/config.d.ts +4 -2
  26. package/dist-types/types/config.d.ts.map +1 -1
  27. package/dist-types/types/index.d.ts +1 -0
  28. package/dist-types/types/index.d.ts.map +1 -1
  29. package/dist-types/types/logger.d.ts +2 -2
  30. package/dist-types/types/logger.d.ts.map +1 -1
  31. package/dist-types/utils.d.ts.map +1 -1
  32. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ let lastTrackTime, lastFileInfo, logger;
1
2
  import __rslib_shim_module__ from 'module';
2
3
  let require = __rslib_shim_module__.createRequire(import.meta.url);
3
4
  import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
@@ -6,14 +7,14 @@ import * as __WEBPACK_EXTERNAL_MODULE__compiled_webpack_bundle_analyzer_index_js
6
7
  import * as __WEBPACK_EXTERNAL_MODULE__compiled_webpack_merge_index_js_efd91626__ from "../compiled/webpack-merge/index.js";
7
8
  import { experiments, rspack } from "@rspack/core";
8
9
  import picocolors from "picocolors";
9
- import node_fs from "node:fs";
10
- import node_path, { join, sep } from "node:path";
11
- import { pathToFileURL } from "node:url";
12
- import { createJiti } from "jiti";
13
10
  import node_readline from "node:readline";
11
+ import node_fs from "node:fs";
14
12
  import node_net from "node:net";
15
13
  import node_os, { platform } from "node:os";
14
+ import node_path, { join, sep } from "node:path";
16
15
  import portfinder from "portfinder";
16
+ import { pathToFileURL } from "node:url";
17
+ import { createJiti } from "jiti";
17
18
  import { expand } from "dotenv-expand";
18
19
  import { TsCheckerRspackPlugin } from "ts-checker-rspack-plugin";
19
20
  import node_assert from "node:assert";
@@ -22,9 +23,9 @@ import typed_css_modules from "typed-css-modules";
22
23
  import { exec, spawn } from "node:child_process";
23
24
  import { promisify } from "node:util";
24
25
  import node_zlib from "node:zlib";
26
+ import { RspackDevServer } from "@rspack/dev-server";
25
27
  import cors from "cors";
26
28
  import express from "express";
27
- import webpack_dev_server from "webpack-dev-server";
28
29
  import chokidar from "chokidar";
29
30
  var LogColor, __webpack_modules__ = {
30
31
  "compiled/webpack-bundle-analyzer": function(module) {
@@ -51,8 +52,14 @@ let colors = {
51
52
  for (let char of chars)isWord(char) && (r += rStep, g += gStep, b += bStep), output += `\x1b[38;2;${Math.round(r)};${Math.round(g)};${Math.round(b)}m${char}\x1b[39m`;
52
53
  return output;
53
54
  }
55
+ }, restartCleaners = [], addRestartCleaner = (...cleaners)=>{
56
+ restartCleaners.push(...cleaners);
57
+ }, cleanUpBeforeRestart = async ()=>{
58
+ await Promise.all(restartCleaners.map((cleaner)=>cleaner())), restartCleaners.length = 0;
59
+ }, currentDevUnpackConfig = {}, setCurrentDevUnpackConfig = (config)=>{
60
+ currentDevUnpackConfig = config;
54
61
  };
55
- var logger_LogColor = ((LogColor = {}).error = "red", LogColor.warn = "yellow", LogColor.info = "cyan", LogColor.ready = "green", LogColor.event = "magenta", LogColor.wait = "blue", LogColor.debug = "dim", LogColor);
62
+ var logger_LogColor = ((LogColor = {}).error = "red", LogColor.warn = "yellow", LogColor.info = "cyan", LogColor.ready = "green", LogColor.event = "magenta", LogColor.wait = "blue", LogColor);
56
63
  let CSS_MODULES_LOCAL_IDENT_NAME = '[path][name]__[local]--[hash:5]', CSS_MODULES_REGEX = /\.module\.\w+$/i, DEV_DEFAULT_FILENAME = {
57
64
  js: 'js/[name].js',
58
65
  jsAsync: 'js/async/[name].js',
@@ -63,7 +70,7 @@ let CSS_MODULES_LOCAL_IDENT_NAME = '[path][name]__[local]--[hash:5]', CSS_MODULE
63
70
  jsAsync: 'js/async/[name].[contenthash:8].js',
64
71
  css: 'css/[name].[contenthash:8].css',
65
72
  cssAsync: 'css/async/[name].[contenthash:8].css'
66
- }, EXPORT_LOCALS_CONVENTION = 'camel-case-only', TEMP_DIR = 'node_modules/.unpack', NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/, CSS_NAMED_EXPORT = !1, THREAD_OPTIONS = {
73
+ }, EXPORT_LOCALS_CONVENTION = 'camel-case-only', TEMP_DIR = 'node_modules/.unpack', NODE_MODULES_REGEX = /[\\/]node_modules[\\/]/, THREAD_OPTIONS = {
67
74
  workers: 2
68
75
  }, DEFAULT_DEV_HOST = '0.0.0.0', TEMPLATE_CONTENT = ({ title = '', headTag = '', mountId = '' })=>`<!DOCTYPE html>
69
76
  <html lang="en">
@@ -177,12 +184,11 @@ let debounce = (fn, delay)=>{
177
184
  });
178
185
  return addressUrls;
179
186
  }, trackPerformance = (msg)=>{
180
- let k = '__unpack_last_track_time';
181
- if (!global[k]) {
182
- global[k] = performance.now();
187
+ if (!lastTrackTime) {
188
+ lastTrackTime = performance.now();
183
189
  return;
184
190
  }
185
- msg && console.log(` ${msg} ${colors.dim('in')} ${colors.yellow(`${(performance.now() - global[k]).toFixed(2)}ms`)}`), global[k] = performance.now();
191
+ msg && console.log(` ${msg} ${colors.dim('in')} ${colors.yellow(`${(performance.now() - lastTrackTime).toFixed(2)}ms`)}`), lastTrackTime = performance.now();
186
192
  }, getPathInJs = (absPath)=>JSON.stringify(absPath).slice(1, -1), mergeConfig = merge, getUserDepVersion = (root, dep)=>{
187
193
  let depPath = getUserDepPath(root, dep);
188
194
  if (depPath) return JSON.parse(node_fs.readFileSync(node_path.resolve(depPath, 'package.json'), 'utf-8')).version;
@@ -223,50 +229,98 @@ let isCSSModules = ({ resourcePath, modules })=>{
223
229
  if (!browsers) throw Error(`Unsupported ES version: ${esVersion}`);
224
230
  return browsers;
225
231
  }, logger_prefixes = {
226
- wait: "\u25CB",
227
- error: "\u2A2F",
228
- warn: "\u26A0",
229
- info: "\u2139",
230
- ready: "\u2713",
231
- event: "\xbb",
232
- debug: "\u279C"
233
- }, logger_logger = (()=>{
234
- let logger = {
235
- clear: ()=>{
236
- let repeatCount = process.stdout.rows - 2;
237
- console.log(repeatCount > 0 ? '\n'.repeat(repeatCount) : ''), node_readline.cursorTo(process.stdout, 0, 0), node_readline.clearScreenDown(process.stdout);
238
- },
239
- greet: (msg)=>{
240
- let { npm_execpath, npm_lifecycle_event } = process.env;
241
- (!npm_execpath || 'npx' === npm_lifecycle_event || npm_execpath.includes('npx-cli') || npm_execpath.includes('.bun') || npm_execpath.includes('yarn')) && console.log(), console.log(msg);
242
- }
232
+ wait: '○',
233
+ error: '⨯',
234
+ warn: '⚠',
235
+ info: 'ℹ',
236
+ ready: '✓',
237
+ event: '»'
238
+ }, logger_logger = (logger = {
239
+ clear: ()=>{
240
+ let repeatCount = process.stdout.rows - 2;
241
+ console.log(repeatCount > 0 ? '\n'.repeat(repeatCount) : ''), node_readline.cursorTo(process.stdout, 0, 0), node_readline.clearScreenDown(process.stdout);
242
+ },
243
+ greet: (msg)=>{
244
+ let { npm_execpath, npm_lifecycle_event } = process.env;
245
+ (!npm_execpath || 'npx' === npm_lifecycle_event || npm_execpath.includes('npx-cli') || npm_execpath.includes('.bun') || npm_execpath.includes('yarn')) && console.log(), console.log(msg);
246
+ },
247
+ debug: (message, ...args)=>{
248
+ isDebug() && console.log(`${colors.gray(colors.dim(getTime()))} ${message}`, ...args);
249
+ }
250
+ }, Object.keys(logger_prefixes).forEach((type)=>{
251
+ logger[type] = (message, ...args)=>{
252
+ ((type, message, ...args)=>{
253
+ let label = colors[logger_LogColor[type]](logger_prefixes[type]), text = '';
254
+ switch(type){
255
+ case 'error':
256
+ if (message instanceof Error) if (message.stack) {
257
+ let [name, ...rest] = message.stack.split('\n');
258
+ name.startsWith('Error: ') && (name = name.slice(7), rest = rest.map((line)=>line.slice(2))), text = `${colors.red(name)}\n${colors.dim(rest.join('\n'))}`;
259
+ } else text = colors.red(message.message);
260
+ else text = colors.red(message);
261
+ break;
262
+ case 'warn':
263
+ text = colors.yellow(message);
264
+ break;
265
+ default:
266
+ text = message;
267
+ }
268
+ console.log(`${label} ${text}`, ...args);
269
+ })(type, message, ...args);
243
270
  };
244
- return Object.keys(logger_prefixes).forEach((type)=>{
245
- logger[type] = (message, ...args)=>{
246
- ((type, message, ...args)=>{
247
- let label = colors[logger_LogColor[type]](logger_prefixes[type]), text = '';
248
- switch(type){
249
- case 'error':
250
- if (message instanceof Error) if (message.stack) {
251
- let [name, ...rest] = message.stack.split('\n');
252
- name.startsWith('Error: ') && (name = name.slice(7), rest = rest.map((line)=>line.slice(2))), text = `${colors.red(name)}\n${colors.dim(rest.join('\n'))}`;
253
- } else text = colors.red(message.message);
254
- else text = colors.red(message);
255
- break;
256
- case 'warn':
257
- text = colors.yellow(message);
258
- break;
259
- case 'debug':
260
- text = `${colors.dim(getTime())} ${colors.magenta('debug')} ${message}`;
261
- break;
262
- default:
263
- text = message;
271
+ }), logger);
272
+ async function setupCliShortcuts({ help = !0, openPage, closeServer, printUrls, restartServer }) {
273
+ let shortcuts = [
274
+ restartServer ? {
275
+ key: 'r',
276
+ description: 'restart server',
277
+ action: restartServer
278
+ } : null,
279
+ {
280
+ key: 'u',
281
+ description: 'show server url',
282
+ action: printUrls
283
+ },
284
+ {
285
+ key: 'o',
286
+ description: 'open in browser',
287
+ action: openPage
288
+ },
289
+ {
290
+ key: 'c',
291
+ description: 'clear console',
292
+ action: ()=>{
293
+ logger_logger.clear();
294
+ }
295
+ },
296
+ {
297
+ key: 'q',
298
+ description: 'quit',
299
+ action: async ()=>{
300
+ try {
301
+ await closeServer();
302
+ } finally{
303
+ process.exit(0);
264
304
  }
265
- ('debug' !== type || isDebug()) && console.log(`${label} ${text}`, ...args);
266
- })(type, message, ...args);
267
- };
268
- }), logger;
269
- })();
305
+ }
306
+ }
307
+ ].filter(Boolean), colorPrefix = colors.green(colors.dim('➜'));
308
+ help && console.log(!0 === help ? ` ${colorPrefix} ${colors.dim('press')} ${colors.bold('h + enter')} ${colors.dim('to show help')}` : ` ${colorPrefix} ${help}`);
309
+ let { createInterface } = await import("node:readline"), rl = createInterface({
310
+ input: process.stdin
311
+ });
312
+ rl.on('line', (input)=>{
313
+ if ('h' === input) {
314
+ let message = '\n Shortcuts\n';
315
+ for (let shortcut of shortcuts){
316
+ let fullDescription = `${colors.dim('press')} ${colors.bold(`${shortcut.key} + enter`)} ${colors.dim(`to ${shortcut.description}`)}`;
317
+ message += ` ${fullDescription}\n`;
318
+ }
319
+ console.log(message);
320
+ }
321
+ for (let shortcut of shortcuts)if (input === shortcut.key) return void shortcut.action();
322
+ }), addRestartCleaner(()=>rl.close());
323
+ }
270
324
  var config_filename = __webpack_fileURLToPath__(import.meta.url);
271
325
  async function loadConfig({ cliOptions, command }) {
272
326
  'build' === command ? setNodeEnv((null == cliOptions ? void 0 : cliOptions.watch) ? 'development' : 'production') : (setNodeEnv('development'), setDevServer(!0));
@@ -317,7 +371,10 @@ async function loadConfig({ cliOptions, command }) {
317
371
  'bundleAnalyze'
318
372
  ], cliOptions.analyze), (null == cliOptions ? void 0 : cliOptions.root) && setValueByPath(configExport, [
319
373
  'root'
320
- ], root), configExport;
374
+ ], root), (null == cliOptions ? void 0 : cliOptions.host) && setValueByPath(configExport, [
375
+ 'server',
376
+ 'host'
377
+ ], cliOptions.host), configExport;
321
378
  }
322
379
  function defineConfig(config) {
323
380
  return config;
@@ -571,7 +628,7 @@ class TypedCssModulesPlugin {
571
628
  constructor(options){
572
629
  _define_property(this, "dtsCreator", void 0), _define_property(this, "useIncremental", !1), _define_property(this, "globPattern", 'src/**/*.{css,less,scss}'), _define_property(this, "userOptions", void 0), this.userOptions = options, this.dtsCreator = new DtsCreator({
573
630
  camelCase: !0,
574
- namedExports: CSS_NAMED_EXPORT
631
+ namedExports: !1
575
632
  });
576
633
  }
577
634
  }
@@ -588,7 +645,7 @@ class JsMinifyPlugin {
588
645
  apply(compiler) {
589
646
  let meta = JSON.stringify({
590
647
  name: jsMinify_PLUGIN_NAME,
591
- version: "3.2.7",
648
+ version: "3.3.1",
592
649
  options: this.minifyOptions
593
650
  });
594
651
  compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
@@ -624,37 +681,7 @@ class JsMinifyPlugin {
624
681
  }
625
682
  }
626
683
  var oxlint_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
627
- function oxlint_define_property(obj, key, value) {
628
- return key in obj ? Object.defineProperty(obj, key, {
629
- value: value,
630
- enumerable: !0,
631
- configurable: !0,
632
- writable: !0
633
- }) : obj[key] = value, obj;
634
- }
635
684
  class OxlintPlugin {
636
- getGitChangedFiles() {
637
- return new Promise((resolve)=>{
638
- var _child_stdout;
639
- let child = spawn('git', [
640
- 'status',
641
- '--porcelain'
642
- ], {
643
- cwd: process.cwd(),
644
- stdio: 'pipe'
645
- }), output = '';
646
- null == (_child_stdout = child.stdout) || _child_stdout.on('data', (data)=>{
647
- output += data.toString();
648
- }), child.on('exit', (code)=>{
649
- 0 === code ? resolve(output.trim().split('\n').filter(Boolean).map((line)=>{
650
- let idx = line.indexOf(' '), status = line.slice(0, idx), filePath = line.slice(idx + 1).trim();
651
- return status.includes('D') ? null : ((status.startsWith('R') || status.startsWith('C')) && (filePath = filePath.split(' -> ')[1]), filePath);
652
- }).filter(Boolean).map((file)=>node_path.resolve(process.cwd(), file))) : resolve([]);
653
- }), child.on('error', ()=>{
654
- resolve([]);
655
- });
656
- });
657
- }
658
685
  runOxlint(args) {
659
686
  var _child_stdout, _child_stderr;
660
687
  let child = spawn('npx', [
@@ -672,34 +699,31 @@ class OxlintPlugin {
672
699
  null == (_child_stdout = child.stdout) || _child_stdout.on('data', (data)=>{
673
700
  output += data.toString();
674
701
  }), child.on('exit', (code)=>{
675
- output.includes('Found 0 warnings and 0 errors') && 0 === code || process.stdout.write(output);
702
+ let hasErrors = !output.includes('Found 0 warnings and 0 errors'), hasNoFiles = output.includes('on 0 files');
703
+ (hasErrors || 0 !== code) && !hasNoFiles && process.stdout.write(output);
676
704
  }), null == (_child_stderr = child.stderr) || _child_stderr.on('data', (data)=>{
677
705
  process.stderr.write(data);
678
706
  });
679
707
  }
680
708
  apply(compiler) {
681
709
  compiler.hooks.watchRun.tap('OxlintPlugin', ()=>{
682
- this.timeoutId && clearTimeout(this.timeoutId), this.timeoutId = setTimeout(()=>{
683
- let configPath = node_path.resolve(oxlint_dirname, '.oxlintrc.json');
684
- this.getGitChangedFiles().then((changedFiles)=>{
685
- if (changedFiles.length > 0) {
686
- let args = [
687
- 'oxlint',
688
- '-c',
689
- configPath,
690
- ...changedFiles,
691
- '--fix',
692
- '--fix-suggestions'
693
- ];
694
- this.runOxlint(args);
695
- }
696
- });
697
- }, this.debounceTime);
710
+ let configPath = node_path.resolve(oxlint_dirname, '.oxlintrc.json'), changedFiles = compiler.modifiedFiles ? Array.from(compiler.modifiedFiles) : [];
711
+ if (1 === changedFiles.length) {
712
+ let currentFile = changedFiles[0];
713
+ if (node_fs.existsSync(currentFile) && node_fs.statSync(currentFile).isFile()) {
714
+ let args = [
715
+ 'oxlint',
716
+ '-c',
717
+ configPath,
718
+ currentFile,
719
+ '--fix',
720
+ '--fix-suggestions'
721
+ ];
722
+ this.runOxlint(args);
723
+ }
724
+ }
698
725
  });
699
726
  }
700
- constructor(){
701
- oxlint_define_property(this, "timeoutId", null), oxlint_define_property(this, "debounceTime", 200);
702
- }
703
727
  }
704
728
  function loadingAnimation_define_property(obj, key, value) {
705
729
  return key in obj ? Object.defineProperty(obj, key, {
@@ -719,16 +743,16 @@ class LoadingAnimation {
719
743
  }
720
744
  constructor(){
721
745
  loadingAnimation_define_property(this, "chars", [
722
- "\u280B",
723
- "\u2819",
724
- "\u2839",
725
- "\u2838",
726
- "\u283C",
727
- "\u2834",
728
- "\u2826",
729
- "\u2827",
730
- "\u2807",
731
- "\u280F"
746
+ '⠋',
747
+ '⠙',
748
+ '⠹',
749
+ '⠸',
750
+ '⠼',
751
+ '⠴',
752
+ '⠦',
753
+ '⠧',
754
+ '⠇',
755
+ '⠏'
732
756
  ]), loadingAnimation_define_property(this, "currentIndex", 0), loadingAnimation_define_property(this, "lastUpdateTime", 0), loadingAnimation_define_property(this, "interval", 100);
733
757
  }
734
758
  }
@@ -794,7 +818,7 @@ async function printFileSize({ root, stats }) {
794
818
  }), longest = 0, totalSize = 0, totalCompressedSize = 0;
795
819
  await Promise.all(origin.assets.map(async (asset)=>{
796
820
  let content = await node_fs.promises.readFile(node_path.join(distPath, asset.name)), size = content.length, compressedSize = await getCompressedSize(content);
797
- totalSize += size, totalCompressedSize += compressedSize, compressedCount++, logUpdate(`${loadingAnimation.getCurrentChar()} computing gzip size (${compressedCount})...`), compressedCount === origin.assets.length && (logUpdate(`\u{2713} computed gzip size (${compressedCount})`), console.log());
821
+ totalSize += size, totalCompressedSize += compressedSize, compressedCount++, logUpdate(`${loadingAnimation.getCurrentChar()} computing gzip size (${compressedCount})...`), compressedCount === origin.assets.length && (logUpdate(`✓ computed gzip size (${compressedCount})`), console.log());
798
822
  let chunk = {
799
823
  name: node_path.basename(asset.name),
800
824
  path: `${distFolder}/${asset.name}`,
@@ -820,11 +844,11 @@ async function printFileSize({ root, stats }) {
820
844
  chunkGroups.forEach((group)=>{
821
845
  group.chunks.sort((a, b)=>a.size - b.size).forEach((chunk)=>{
822
846
  let isLarge = 'JS' === group.type && chunk.size / 1000 > 500, relativeOutDir = node_path.dirname(chunk.path) + '/', log = colors.dim(relativeOutDir);
823
- log += colors[group.color](chunk.name.padEnd(longest + 2 - relativeOutDir.length)), log += colors[isLarge ? 'yellow' : 'dim'](displaySize(chunk.size).padStart(sizePad)), chunk.compressedSize && (log += colors.dim(` \u{2502} gzip: ${displaySize(chunk.compressedSize).padStart(compressPad)}`)), console.log(log);
847
+ log += colors[group.color](chunk.name.padEnd(longest + 2 - relativeOutDir.length)), log += colors[isLarge ? 'yellow' : 'dim'](displaySize(chunk.size).padStart(sizePad)), chunk.compressedSize && (log += colors.dim(` gzip: ${displaySize(chunk.compressedSize).padStart(compressPad)}`)), console.log(log);
824
848
  });
825
849
  });
826
850
  let log = colors.blue('Total'.padEnd(longest + 2));
827
- log += colors.blue(displaySize(totalSize)), console.log(log += colors.dim(` \u{2502} gzip: ${displaySize(totalCompressedSize)}`));
851
+ log += colors.blue(displaySize(totalSize)), console.log(log += colors.dim(` gzip: ${displaySize(totalCompressedSize)}`));
828
852
  }
829
853
  function isLikelyFile(filePath) {
830
854
  return (filePath.split(sep).pop() || '').includes('.');
@@ -834,29 +858,13 @@ function formatFileList(paths, rootPath) {
834
858
  0 === files.length && (files = [
835
859
  paths[0]
836
860
  ]);
837
- let fileInfo = files.slice(0, 1).map((file)=>(function(originalFilePath, root) {
838
- let prefix = root.endsWith(sep) ? root : root + sep, filePath = originalFilePath;
839
- filePath.startsWith(prefix) && (filePath = filePath.slice(prefix.length));
840
- let parts = filePath.split(sep).filter(Boolean);
841
- return parts.length > 3 ? parts.slice(-3).join(sep) : parts.join(sep);
842
- })(file, rootPath)).join(', ');
861
+ let fileInfo = files.slice(0, 1).map((file)=>{
862
+ let prefix, filePath, parts;
863
+ return prefix = rootPath.endsWith(sep) ? rootPath : rootPath + sep, (filePath = file).startsWith(prefix) && (filePath = filePath.slice(prefix.length)), (parts = filePath.split(sep).filter(Boolean)).length > 3 ? parts.slice(-3).join(sep) : parts.join(sep);
864
+ }).join(', ');
843
865
  return files.length > 1 ? `${fileInfo} and ${files.length - 1} more` : fileInfo;
844
866
  }
845
- function printDevLog(compiler, root) {
846
- let changedFiles = compiler.modifiedFiles ? Array.from(compiler.modifiedFiles) : null;
847
- if (null == changedFiles ? void 0 : changedFiles.length) {
848
- let fileInfo = formatFileList(changedFiles, root);
849
- logger_logger.wait(`building ${colors.dim(fileInfo)}`);
850
- return;
851
- }
852
- let removedFiles = compiler.removedFiles ? Array.from(compiler.removedFiles) : null;
853
- if (null == removedFiles ? void 0 : removedFiles.length) {
854
- let fileInfo = formatFileList(removedFiles, root);
855
- logger_logger.wait(`building ${colors.dim(`removed ${fileInfo}`)}`);
856
- return;
857
- }
858
- logger_logger.wait('building...');
859
- }
867
+ let sameCount = 0;
860
868
  async function compileDone(compiler, stats) {
861
869
  let compileTime = stats.toJson({
862
870
  preset: 'errors-only',
@@ -867,27 +875,35 @@ async function compileDone(compiler, stats) {
867
875
  stats
868
876
  }), logger_logger.ready(colors.green(`built in ${prettyTime(compileTime)}`));
869
877
  else {
870
- if (isDebug()) {
871
- let modules = stats.compilation.modules, nodeModulesStats = new Map(), nodeModulesPath = node_path.resolve(root, 'node_modules');
872
- modules.forEach((module)=>{
878
+ let fileInfo = function(changedFiles, removedFiles, root) {
879
+ if (!(null == changedFiles ? void 0 : changedFiles.length) && !(null == removedFiles ? void 0 : removedFiles.length)) return null;
880
+ if ((null == changedFiles ? void 0 : changedFiles.length) && (null == removedFiles ? void 0 : removedFiles.length)) {
881
+ let changedInfo = formatFileList(changedFiles, root), removedInfo = formatFileList(removedFiles, root);
882
+ return `${changedInfo}, removed ${removedInfo}`;
883
+ }
884
+ return (null == changedFiles ? void 0 : changedFiles.length) ? formatFileList(changedFiles, root) : (null == removedFiles ? void 0 : removedFiles.length) ? `removed ${formatFileList(removedFiles, root)}` : null;
885
+ }(compiler.modifiedFiles ? Array.from(compiler.modifiedFiles) : null, compiler.removedFiles ? Array.from(compiler.removedFiles) : null, root);
886
+ if (!fileInfo) return;
887
+ if (fileInfo === lastFileInfo ? sameCount++ : (lastFileInfo = fileInfo, sameCount = 1), isDebug()) {
888
+ var modules;
889
+ let nodeModulesStats, nodeModulesPath;
890
+ Object.entries((modules = stats.compilation.modules, nodeModulesStats = {}, nodeModulesPath = node_path.resolve(root, 'node_modules'), modules.forEach((module)=>{
873
891
  let { resource } = module;
874
892
  if (null == resource ? void 0 : resource.includes(nodeModulesPath)) {
875
893
  let packageName, pathParts = node_path.relative(nodeModulesPath, resource).split(sep);
876
- (packageName = '.pnpm' === pathParts[0] && pathParts.length >= 4 ? pathParts[3].startsWith('@') ? `${pathParts[3]}/${pathParts[4]}` : pathParts[3] : pathParts[0].startsWith('@') ? `${pathParts[0]}/${pathParts[1]}` : pathParts[0]) && nodeModulesStats.set(packageName, (nodeModulesStats.get(packageName) || 0) + 1);
894
+ (packageName = '.pnpm' === pathParts[0] && pathParts.length >= 4 ? pathParts[3].startsWith('@') ? `${pathParts[3]}/${pathParts[4]}` : pathParts[3] : pathParts[0].startsWith('@') ? `${pathParts[0]}/${pathParts[1]}` : pathParts[0]) && (nodeModulesStats[packageName] = (nodeModulesStats[packageName] || 0) + 1);
877
895
  }
878
- }), nodeModulesStats.size > 0 && Array.from(nodeModulesStats.entries()).sort((a, b)=>a[1] - b[1]).forEach(([packageName, count])=>{
896
+ }), nodeModulesStats)).sort((a, b)=>a[1] - b[1]).forEach(([packageName, count])=>{
879
897
  logger_logger.debug(`${colors.cyan(packageName)}: ${colors.yellow(count)} modules`);
880
898
  });
881
899
  }
882
- logger_logger.ready(`built in ${prettyTime(compileTime)}${isDebug() ? ` (${stats.compilation.modules.size} modules)` : ''}`);
900
+ isDebug() || logger_logger.clear(), console.log(colors.dim(getTime()), colors.cyan(colors.bold(`[${global.__unpack_caller_name}]`)), colors.green(utils_isDevServer() ? 'hmr update' : 'build'), `${colors.dim(fileInfo)}${sameCount > 1 ? ` ${colors.yellow(`(x${sameCount})`)}` : ''}`, isDebug() ? colors.dim(`| ${prettyTime(compileTime)} (${stats.compilation.modules.size} modules)`) : '');
883
901
  }
884
902
  }
885
903
  let progress_PLUGIN_NAME = 'ProgressPlugin';
886
904
  class ProgressLiteRspackPlugin {
887
905
  apply(compiler) {
888
- compiler.hooks.watchRun.tap(progress_PLUGIN_NAME, ()=>{
889
- (!utils_isDevServer() || global.__unpack_dev_server_started) && printDevLog(compiler, compiler.options.context);
890
- }), compiler.hooks.run.tap(progress_PLUGIN_NAME, ()=>{
906
+ compiler.hooks.run.tap(progress_PLUGIN_NAME, ()=>{
891
907
  logger_logger.info('build started...');
892
908
  }), compiler.hooks.afterDone.tap(progress_PLUGIN_NAME, async (stats)=>{
893
909
  await compileDone(compiler, stats);
@@ -896,9 +912,7 @@ class ProgressLiteRspackPlugin {
896
912
  }
897
913
  class ProgressRspackPlugin extends rspack.ProgressPlugin {
898
914
  apply(compiler) {
899
- super.apply(compiler), compiler.hooks.watchRun.tap(progress_PLUGIN_NAME, ()=>{
900
- (!utils_isDevServer() || global.__unpack_dev_server_started) && printDevLog(compiler, compiler.options.context);
901
- }), compiler.hooks.afterDone.tap(progress_PLUGIN_NAME, async (stats)=>{
915
+ super.apply(compiler), compiler.hooks.afterDone.tap(progress_PLUGIN_NAME, async (stats)=>{
902
916
  await compileDone(compiler, stats);
903
917
  });
904
918
  }
@@ -1097,10 +1111,9 @@ async function getBundlerConfig(originalUnpackConfig) {
1097
1111
  let filePath = module.replace(/^.*!/, ''), relativePath = node_path.relative(unpackConfig.root, filePath);
1098
1112
  return relativePath.startsWith('..') ? filePath : relativePath;
1099
1113
  }).slice(0, -1);
1100
- if (2 + uniquePaths.join(" \u2192 ").length > (process.stdout.columns || 80)) {
1101
- console.log('');
1102
- let arrow = "\u21B3 ", lastIndex = uniquePaths.length - 1;
1103
- uniquePaths.forEach((p, i)=>{
1114
+ if (2 + uniquePaths.join(' ').length > (process.stdout.columns || 80)) {
1115
+ let arrow, lastIndex;
1116
+ console.log(''), arrow = '↳ ', lastIndex = uniquePaths.length - 1, uniquePaths.forEach((p, i)=>{
1104
1117
  switch(i){
1105
1118
  case 0:
1106
1119
  console.log(` ${p}`);
@@ -1113,12 +1126,10 @@ async function getBundlerConfig(originalUnpackConfig) {
1113
1126
  }
1114
1127
  }), console.log(` ${arrow}${uniquePaths[0]}`), console.log('');
1115
1128
  } else {
1116
- let line1 = ' ', downArrowPos = 0;
1117
- uniquePaths.forEach((p, i)=>{
1118
- line1 += p, i < uniquePaths.length - 1 ? line1 += " \u2192 " : downArrowPos = line1.length - 1;
1119
- });
1120
- let lineLength = downArrowPos - 2;
1121
- console.log(''), console.log(line1), console.log(' ' + ' '.repeat(0) + "\u2191" + ' '.repeat(downArrowPos - 2 - 1) + "\u2193"), console.log(' ' + ' '.repeat(0) + "\u2514" + "\u2500".repeat(lineLength - 1) + "\u2518"), console.log('');
1129
+ let line1, downArrowPos, lineLength;
1130
+ line1 = ' ', downArrowPos = 0, uniquePaths.forEach((p, i)=>{
1131
+ line1 += p, i < uniquePaths.length - 1 ? line1 += ' ' : downArrowPos = line1.length - 1;
1132
+ }), lineLength = downArrowPos - 2, console.log(''), console.log(line1), console.log(' ' + ' '.repeat(0) + '↑' + ' '.repeat(downArrowPos - 2 - 1) + '↓'), console.log(' ' + ' '.repeat(0) + '└' + '─'.repeat(lineLength - 1) + '┘'), console.log('');
1122
1133
  }
1123
1134
  },
1124
1135
  onEnd () {
@@ -1161,9 +1172,7 @@ async function getBundlerConfig(originalUnpackConfig) {
1161
1172
  experiments: {
1162
1173
  css: !1,
1163
1174
  asyncWebAssembly: !0,
1164
- lazyBarrel: !0,
1165
- inlineEnum: !0,
1166
- typeReexportsPresence: !0
1175
+ lazyBarrel: !0
1167
1176
  },
1168
1177
  optimization: {
1169
1178
  moduleIds: isDev() ? 'named' : 'deterministic',
@@ -1234,7 +1243,7 @@ async function getBundlerConfig(originalUnpackConfig) {
1234
1243
  'parser',
1235
1244
  'css/module'
1236
1245
  ], {
1237
- namedExports: CSS_NAMED_EXPORT
1246
+ namedExports: !1
1238
1247
  }), setValueByPath(config, [
1239
1248
  'module',
1240
1249
  'generator',
@@ -1387,7 +1396,7 @@ async function getBundlerConfig(originalUnpackConfig) {
1387
1396
  })(),
1388
1397
  localIdentName: !1 !== modules && (modules.localIdentName || CSS_MODULES_LOCAL_IDENT_NAME),
1389
1398
  exportLocalsConvention: EXPORT_LOCALS_CONVENTION,
1390
- namedExport: CSS_NAMED_EXPORT
1399
+ namedExport: !1
1391
1400
  },
1392
1401
  sourceMap
1393
1402
  }
@@ -1503,7 +1512,6 @@ async function unpackBuild(unpackConfig) {
1503
1512
  };
1504
1513
  isWatch() ? compiler.watch({}, handler) : compiler.run(handler);
1505
1514
  }
1506
- let restartCleaners = [];
1507
1515
  var openBrowser_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
1508
1516
  async function openBrowser(url) {
1509
1517
  if ('darwin' === process.platform) try {
@@ -1572,19 +1580,20 @@ let getExternalLibraryName = (pkgName)=>({
1572
1580
  'react-dom': 'ReactDOM',
1573
1581
  'react-router-dom': 'ReactRouterDOM'
1574
1582
  })[pkgName] || pkgName, getExternalValue = (pkgName)=>`window ${getExternalLibraryName(pkgName)}`, prebundleDeps = async ({ unpackConfig })=>{
1575
- var _unpackConfig_dev;
1576
- let count = {
1583
+ var _unpackConfig_dev, externals;
1584
+ let existExternals, cacheDir, count = {
1577
1585
  total: 0,
1578
1586
  bundled: 0
1579
1587
  }, failedDeps = [], root = unpackConfig.root, failedDepsCachePath = node_path.resolve(root, TEMP_DIR, 'failed-deps.json'), failedCache = node_fs.existsSync(failedDepsCachePath) ? JSON.parse(node_fs.readFileSync(failedDepsCachePath, 'utf-8')) : {}, updateProgress = ()=>{
1580
- logUpdate(`${colors.magenta("\xbb")} optimizing dependencies (${count.bundled}/${count.total})`), count.total === count.bundled + failedDeps.length && console.log();
1588
+ logUpdate(`${colors.magenta('»')} optimizing dependencies (${count.bundled}/${count.total})`), count.total === count.bundled + failedDeps.length && console.log();
1581
1589
  }, userOptions = isPlainObject(null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.prebundle) ? unpackConfig.dev.prebundle : {}, ignoreCSSDeps = userOptions.ignoreCSS || [], packageJson = JSON.parse(node_fs.readFileSync(node_path.resolve(root, 'package.json'), 'utf-8')), excludeDeps = [
1582
- ...((externals)=>{
1583
- let existExternals = new Set();
1584
- return Array.isArray(externals) ? externals.forEach((item)=>{
1585
- isPlainObject(item) && Object.keys(item).forEach((key)=>existExternals.add(key));
1586
- }) : isPlainObject(externals) && Object.keys(externals).forEach((key)=>existExternals.add(key)), Array.from(existExternals);
1587
- })(unpackConfig.externals) || [],
1590
+ ...(externals = unpackConfig.externals, existExternals = new Set(), Array.isArray(externals) ? externals.forEach((item)=>{
1591
+ isPlainObject(item) && Object.keys(item).forEach((key)=>{
1592
+ existExternals.add(key);
1593
+ });
1594
+ }) : isPlainObject(externals) && Object.keys(externals).forEach((key)=>{
1595
+ existExternals.add(key);
1596
+ }), Array.from(existExternals) || []),
1588
1597
  ...userOptions.exclude || []
1589
1598
  ], shouldIncludeDeps = Object.keys(packageJson.dependencies).filter((pkgName)=>!excludeDeps.includes(pkgName)), noEntryDeps = [], needBundleDeps = shouldIncludeDeps.map((pkgName)=>{
1590
1599
  let packageJson = JSON.parse(node_fs.readFileSync(node_path.resolve(root, 'node_modules', pkgName, 'package.json'), 'utf-8')), version = packageJson.version;
@@ -1730,17 +1739,17 @@ let getExternalLibraryName = (pkgName)=>({
1730
1739
  resolve(isFailed ? void 0 : getResult());
1731
1740
  });
1732
1741
  });
1733
- }))(depInfo))), cacheDir = node_path.dirname(failedDepsCachePath);
1734
- node_fs.existsSync(cacheDir) || node_fs.mkdirSync(cacheDir, {
1742
+ }))(depInfo)));
1743
+ cacheDir = node_path.dirname(failedDepsCachePath), node_fs.existsSync(cacheDir) || node_fs.mkdirSync(cacheDir, {
1735
1744
  recursive: !0
1736
1745
  }), node_fs.writeFileSync(failedDepsCachePath, JSON.stringify(failedCache, null, 2), 'utf-8'), failedDeps[0] && logger_logger.warn(`something went wrong while optimizing "${colors.bold(failedDeps.join(', '))}"`);
1737
1746
  let cachePath = node_path.resolve(root, TEMP_DIR, 'umd'), app = express();
1738
1747
  app.use(cors()), app.use("/umd", express.static(cachePath));
1739
1748
  let port = await getPort(), staticServer = app.listen(port, ()=>{});
1740
- restartCleaners.push(()=>new Promise((resolve)=>staticServer.close(()=>resolve())));
1741
- let externals = {}, jsAssets = [], cssAssets = [], preJsAssets = [];
1749
+ addRestartCleaner(()=>new Promise((resolve)=>staticServer.close(()=>resolve())));
1750
+ let externals1 = {}, jsAssets = [], cssAssets = [], preJsAssets = [];
1742
1751
  return bundledDeps.filter(Boolean).forEach((dep)=>{
1743
- dep && (externals[dep.name] = getExternalValue(dep.name), dep.assets.forEach((absPath)=>{
1752
+ dep && (externals1[dep.name] = getExternalValue(dep.name), dep.assets.forEach((absPath)=>{
1744
1753
  let relativePath = node_path.relative(cachePath, absPath), preDeps = [
1745
1754
  'react',
1746
1755
  'react-dom',
@@ -1758,10 +1767,10 @@ let getExternalLibraryName = (pkgName)=>({
1758
1767
  }
1759
1768
  }));
1760
1769
  }), unpackConfig.externals = Array.isArray(unpackConfig.externals) ? [
1761
- externals,
1770
+ externals1,
1762
1771
  ...unpackConfig.externals
1763
1772
  ] : {
1764
- ...externals,
1773
+ ...externals1,
1765
1774
  ...unpackConfig.externals
1766
1775
  }, unpackConfig.plugins.push({
1767
1776
  name: 'unpack:prebundle',
@@ -1786,7 +1795,7 @@ let getExternalLibraryName = (pkgName)=>({
1786
1795
  }), unpackConfig;
1787
1796
  };
1788
1797
  async function unpackDev(originalUnpackConfig) {
1789
- var _unpackConfig_dev, _unpackConfig_server, _unpackConfig_server1, _unpackConfig_dev1, _unpackConfig_server2;
1798
+ var _unpackConfig_dev, _unpackConfig_server, _unpackConfig_server1, _unpackConfig_dev1, _unpackConfig_server2, _unpackConfig_server3;
1790
1799
  let unpackConfig = originalUnpackConfig;
1791
1800
  (null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.prebundle) && (unpackConfig = await prebundleDeps({
1792
1801
  unpackConfig
@@ -1821,67 +1830,90 @@ async function unpackDev(originalUnpackConfig) {
1821
1830
  var _req_headers_accept;
1822
1831
  (null == (_req_headers_accept = req.headers.accept) ? void 0 : _req_headers_accept.includes('html')) && (req.url = '/index.html'), next();
1823
1832
  }), middlewares.unshift(experiments.lazyCompilationMiddleware(compiler)), middlewares);
1824
- let server = new webpack_dev_server(devServerOptions, compiler);
1825
- await server.start(), logger_logger.greet(` ${colors.green(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v3.2.7`)} ${colors.dim(`ready in ${colors.reset(Math.ceil(performance.now() - global.__unpack_start_time))}ms`)}\n`), getAddressUrls({
1826
- port: port
1827
- }).forEach((addr)=>{
1833
+ let server = new RspackDevServer(devServerOptions, compiler);
1834
+ await server.start(), logger_logger.greet(` ${colors.green(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v3.3.1`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - global.__unpack_start_time))} ms\n`), printAddressUrls(port, null == (_unpackConfig_server2 = unpackConfig.server) ? void 0 : _unpackConfig_server2.host), addRestartCleaner(()=>server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())));
1835
+ let open = null == (_unpackConfig_server3 = unpackConfig.server) ? void 0 : _unpackConfig_server3.open, url = isString(open) ? open : `http://localhost:${port}`;
1836
+ open && openBrowser(url), setupCliShortcuts({
1837
+ openPage: async ()=>{
1838
+ await openBrowser(url);
1839
+ },
1840
+ closeServer: async ()=>{
1841
+ await cleanUpBeforeRestart(), process.exit(0);
1842
+ },
1843
+ printUrls: ()=>{
1844
+ var _unpackConfig_server;
1845
+ printAddressUrls(port, null == (_unpackConfig_server = unpackConfig.server) ? void 0 : _unpackConfig_server.host);
1846
+ },
1847
+ restartServer: async ()=>{
1848
+ logger_logger.clear(), await cleanUpBeforeRestart(), createUnpack({
1849
+ cwd: currentDevUnpackConfig.root,
1850
+ config: currentDevUnpackConfig
1851
+ }).dev();
1852
+ }
1853
+ });
1854
+ }
1855
+ function printAddressUrls(port, host) {
1856
+ let addressUrls = getAddressUrls({
1857
+ port
1858
+ }), colorPrefix = colors.green('➜');
1859
+ addressUrls.forEach((addr, index)=>{
1828
1860
  let url;
1829
- console.log(` ${colors.green(colors.dim("\u279C"))} ${colors.dim(addr.label)}${(url = addr.url, colors.cyan(url.replace(/:(\d+)\//, (_, port)=>`:${colors.bold(port)}/`)))}`);
1830
- }), logger_logger.wait('building...'), global.__unpack_dev_server_started = !0, restartCleaners.push(async ()=>await server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())), ()=>{
1831
- global.__unpack_dev_server_started = !1;
1861
+ if (!host && 0 !== index) {
1862
+ 1 === index && console.log(` ${colors.dim(colorPrefix)} ${colors.bold(colors.dim('Network:'))} ${colors.dim('use')} ${colors.bold('--host')} ${colors.dim('to expose')}`);
1863
+ return;
1864
+ }
1865
+ console.log(` ${colorPrefix} ${colors.bold(addr.label)}${(url = addr.url, colors.cyan(url.replace(/:(\d+)\//, (_, port)=>`:${colors.bold(port)}/`)))}`);
1832
1866
  });
1833
- let open = null == (_unpackConfig_server2 = unpackConfig.server) ? void 0 : _unpackConfig_server2.open;
1834
- if (open) {
1835
- let url = isString(open) ? open : `http://localhost:${port}`;
1836
- await openBrowser(url);
1837
- }
1838
1867
  }
1839
1868
  function createUnpack({ cwd = process.cwd(), config, callerName = 'unpack' }) {
1840
- let resolveConfig = ()=>({
1841
- ...mergeConfig({
1842
- root: cwd,
1843
- build: {
1844
- outDir: 'dist',
1845
- minify: isProd(),
1846
- sourceMap: !isProd() && 'cheap-module-source-map',
1847
- parallel: !0,
1848
- filenameHash: !0,
1849
- target: 'es2022'
1850
- },
1851
- dev: {
1852
- lazyCompilation: !0
1853
- },
1854
- server: {
1855
- port: 3000
1856
- },
1857
- html: {
1858
- mountId: 'root'
1859
- },
1860
- css: {
1861
- modules: !0,
1862
- transformer: 'postcss',
1863
- sourceMap: !1
1864
- },
1865
- performance: {
1866
- chunkSplit: {
1867
- strategy: 'split-by-experience'
1868
- }
1869
- },
1870
- typeCheck: !0,
1871
- envPrefix: [
1872
- 'PUBLIC_'
1873
- ]
1874
- }, config),
1869
+ let resolveConfig = ()=>{
1870
+ let defaultConfig = {
1871
+ root: cwd,
1872
+ build: {
1873
+ outDir: 'dist',
1874
+ minify: isProd(),
1875
+ sourceMap: !isProd() && 'cheap-module-source-map',
1876
+ parallel: !0,
1877
+ filenameHash: !0,
1878
+ target: 'es2022'
1879
+ },
1880
+ dev: {
1881
+ lazyCompilation: !0
1882
+ },
1883
+ server: {
1884
+ port: 3000
1885
+ },
1886
+ html: {
1887
+ mountId: 'root'
1888
+ },
1889
+ css: {
1890
+ modules: !0,
1891
+ transformer: 'postcss',
1892
+ sourceMap: !1
1893
+ },
1894
+ performance: {
1895
+ chunkSplit: {
1896
+ strategy: 'split-by-experience'
1897
+ }
1898
+ },
1899
+ typeCheck: !0,
1900
+ envPrefix: [
1901
+ 'PUBLIC_'
1902
+ ]
1903
+ };
1904
+ return global.__unpack_caller_name = callerName, {
1905
+ ...mergeConfig(defaultConfig, config),
1875
1906
  _context: {
1876
1907
  callerName,
1877
- version: "3.2.7"
1908
+ version: "3.3.1"
1878
1909
  }
1879
- });
1910
+ };
1911
+ };
1880
1912
  return {
1881
1913
  build: async ({ watch } = {})=>{
1882
1914
  setNodeEnv(watch ? 'development' : 'production');
1883
1915
  let config = resolveConfig();
1884
- console.log(colors.rainbow(`${callerName} v3.2.7`), colors.green(`building for ${getNodeEnv()}...`)), await unpackBuild(config);
1916
+ console.log(colors.rainbow(`${callerName} v3.3.1`), colors.green(`building for ${getNodeEnv()}...`)), await unpackBuild(config);
1885
1917
  },
1886
1918
  dev: async ()=>{
1887
1919
  global.__unpack_start_time = performance.now(), setNodeEnv('development'), setDevServer(!0);
@@ -1903,4 +1935,5 @@ async function createChokidar(pathOrGlobs, root = process.cwd(), options) {
1903
1935
  ...options
1904
1936
  });
1905
1937
  }
1906
- export { CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_REGEX, CSS_NAMED_EXPORT, DEFAULT_DEV_HOST, DEV_DEFAULT_FILENAME, EXPORT_LOCALS_CONVENTION, logger_LogColor as LogColor, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, TEMPLATE_CONTENT, TEMP_DIR, THREAD_OPTIONS, clearLine, colors, createChokidar, createUnpack, debounce, defineConfig, esVersionToBrowserslist, findExists, getAddressUrls, getCompiledPkgPath, getIpv4Interfaces, getNodeEnv, getPathInJs, getPort, getTime, getUserDepPath, getUserDepVersion, getValueByPath, isBoolean, isCI, isCSSModules, isDebug, isDev, utils_isDevServer as isDevServer, isEmptyDir, isFileExists, isFileSync, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isProd, isRegExp, isString, isUndefined, isWatch, isWin, loadConfig, logUpdate, logger_logger as logger, mergeConfig, pathExists, prettyTime, removeDir, resolveConfigPath, restartCleaners, rspack, setDevServer, setNodeEnv, setValueByPath, trackPerformance };
1938
+ var __webpack_exports__CSS_NAMED_EXPORT = !1;
1939
+ export { CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_REGEX, DEFAULT_DEV_HOST, DEV_DEFAULT_FILENAME, EXPORT_LOCALS_CONVENTION, logger_LogColor as LogColor, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, TEMPLATE_CONTENT, TEMP_DIR, THREAD_OPTIONS, addRestartCleaner, cleanUpBeforeRestart, clearLine, colors, createChokidar, createUnpack, currentDevUnpackConfig, debounce, defineConfig, esVersionToBrowserslist, findExists, getAddressUrls, getCompiledPkgPath, getIpv4Interfaces, getNodeEnv, getPathInJs, getPort, getTime, getUserDepPath, getUserDepVersion, getValueByPath, isBoolean, isCI, isCSSModules, isDebug, isDev, utils_isDevServer as isDevServer, isEmptyDir, isFileExists, isFileSync, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isProd, isRegExp, isString, isUndefined, isWatch, isWin, loadConfig, logUpdate, logger_logger as logger, mergeConfig, pathExists, prettyTime, removeDir, resolveConfigPath, rspack, setCurrentDevUnpackConfig, setDevServer, setNodeEnv, setValueByPath, setupCliShortcuts, trackPerformance, __webpack_exports__CSS_NAMED_EXPORT as CSS_NAMED_EXPORT };