@unpackjs/core 4.2.3 → 4.4.0
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 +20 -20
- package/compiled/less-loader/index.js +35 -33
- package/compiled/less-loader/package.json +1 -1
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/sass-loader/index.js +8 -8
- package/compiled/sass-loader/package.json +1 -1
- package/compiled/semver/index.js +164 -164
- package/compiled/semver/package.json +1 -1
- package/dist/index.js +119 -44
- package/dist-types/bundler-config/buildAnalyze.d.ts +3 -3
- package/dist-types/bundler-config/buildAnalyze.d.ts.map +1 -1
- package/dist-types/bundler-config/cache.d.ts +3 -3
- package/dist-types/bundler-config/cache.d.ts.map +1 -1
- package/dist-types/bundler-config/chunkSplit.d.ts +3 -3
- package/dist-types/bundler-config/chunkSplit.d.ts.map +1 -1
- package/dist-types/bundler-config/css.d.ts +3 -3
- package/dist-types/bundler-config/css.d.ts.map +1 -1
- package/dist-types/bundler-config/detectCircular.d.ts +3 -3
- package/dist-types/bundler-config/detectCircular.d.ts.map +1 -1
- package/dist-types/bundler-config/html.d.ts +3 -3
- package/dist-types/bundler-config/html.d.ts.map +1 -1
- package/dist-types/bundler-config/index.d.ts +2 -2
- package/dist-types/bundler-config/index.d.ts.map +1 -1
- package/dist-types/bundler-config/nativeCss.d.ts +3 -3
- package/dist-types/bundler-config/nativeCss.d.ts.map +1 -1
- package/dist-types/bundler-config/plugins/registerHooks.d.ts +3 -0
- package/dist-types/bundler-config/plugins/registerHooks.d.ts.map +1 -1
- package/dist-types/bundler-config/typeCheck.d.ts +3 -3
- package/dist-types/bundler-config/typeCheck.d.ts.map +1 -1
- package/dist-types/plugins/browserLogs.d.ts.map +1 -1
- package/dist-types/plugins/prebundle.d.ts.map +1 -1
- package/dist-types/plugins/svgIcons.d.ts.map +1 -1
- package/dist-types/plugins/unocss.d.ts.map +1 -1
- package/dist-types/progressBar.d.ts +2 -2
- package/dist-types/progressBar.d.ts.map +1 -1
- package/dist-types/run/dev.d.ts.map +1 -1
- package/dist-types/{loadingAnimation.d.ts → spinner.d.ts} +2 -2
- package/dist-types/spinner.d.ts.map +1 -0
- package/dist-types/types/chunkSplit.d.ts +3 -3
- package/dist-types/types/chunkSplit.d.ts.map +1 -1
- package/dist-types/types/config.d.ts +23 -49
- package/dist-types/types/config.d.ts.map +1 -1
- package/dist-types/types/index.d.ts +2 -14
- package/dist-types/types/index.d.ts.map +1 -1
- package/dist-types/types/plugin.d.ts +24 -8
- package/dist-types/types/plugin.d.ts.map +1 -1
- package/dist-types/types/rspack.d.ts +3 -0
- package/dist-types/types/rspack.d.ts.map +1 -0
- package/dist-types/types/thirdParty.d.ts +42 -0
- package/dist-types/types/thirdParty.d.ts.map +1 -0
- package/dist-types/utils.d.ts +4 -3
- package/dist-types/utils.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist-types/loadingAnimation.d.ts.map +0 -1
- package/dist-types/types/oxc.d.ts +0 -10
- package/dist-types/types/oxc.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -338,7 +338,52 @@ function getHtmlTemplateOrContent(rawTemplate, root) {
|
|
|
338
338
|
templateContent
|
|
339
339
|
};
|
|
340
340
|
}
|
|
341
|
-
let
|
|
341
|
+
let VOID_TAGS = new Set([
|
|
342
|
+
'area',
|
|
343
|
+
'base',
|
|
344
|
+
'br',
|
|
345
|
+
'col',
|
|
346
|
+
'embed',
|
|
347
|
+
'hr',
|
|
348
|
+
'img',
|
|
349
|
+
'input',
|
|
350
|
+
'link',
|
|
351
|
+
'meta',
|
|
352
|
+
'param',
|
|
353
|
+
'source',
|
|
354
|
+
'track',
|
|
355
|
+
'wbr'
|
|
356
|
+
]), renderHtmlTagDescriptor = (tag)=>{
|
|
357
|
+
let attrs = tag.attrs || {}, attrsStr = Object.keys(attrs).map((key)=>{
|
|
358
|
+
let value = attrs[key];
|
|
359
|
+
return !1 === value || void 0 === value ? '' : !0 === value ? ` ${key}` : ` ${key}="${String(value).replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>')}"`;
|
|
360
|
+
}).filter(Boolean).join(''), children = tag.children;
|
|
361
|
+
if (null == children || '' === children) return VOID_TAGS.has(tag.tag) ? `<${tag.tag}${attrsStr}>` : `<${tag.tag}${attrsStr}></${tag.tag}>`;
|
|
362
|
+
let inner = 'string' == typeof children ? children : children.map((child)=>renderHtmlTagDescriptor(child)).join('');
|
|
363
|
+
return `<${tag.tag}${attrsStr}>${inner}</${tag.tag}>`;
|
|
364
|
+
}, injectHtml = (html, injectTo, content)=>{
|
|
365
|
+
if (!content) return html;
|
|
366
|
+
let target = injectTo;
|
|
367
|
+
if ('head-prepend' === target) {
|
|
368
|
+
if (/<head(\s*[^>]*)>/i.test(html)) return html.replace(/<head(\s*[^>]*)>/i, (match)=>`${match}${content}`);
|
|
369
|
+
target = 'body-prepend';
|
|
370
|
+
}
|
|
371
|
+
if ('head' === target) {
|
|
372
|
+
if (/<\/head>/i.test(html)) return html.replace(/<\/head>/i, `${content}</head>`);
|
|
373
|
+
target = 'body-prepend';
|
|
374
|
+
}
|
|
375
|
+
return 'body-prepend' === target ? /<body(\s*[^>]*)>/i.test(html) ? html.replace(/<body(\s*[^>]*)>/i, (match)=>`${match}${content}`) : `${content}${html}` : 'body' === target ? /<\/body>/i.test(html) ? html.replace(/<\/body>/i, `${content}</body>`) : `${html}${content}` : html;
|
|
376
|
+
}, applyHtmlTagDescriptors = (html, tags)=>{
|
|
377
|
+
let buckets = {
|
|
378
|
+
'head-prepend': [],
|
|
379
|
+
head: [],
|
|
380
|
+
'body-prepend': [],
|
|
381
|
+
body: []
|
|
382
|
+
};
|
|
383
|
+
for (let tag of tags || [])buckets[tag.injectTo || 'head-prepend'].push(renderHtmlTagDescriptor(tag));
|
|
384
|
+
let result = html;
|
|
385
|
+
return result = injectHtml(result, 'head-prepend', buckets['head-prepend'].join('')), result = injectHtml(result, 'head', buckets.head.join('')), result = injectHtml(result, 'body-prepend', buckets['body-prepend'].join('')), result = injectHtml(result, 'body', buckets.body.join(''));
|
|
386
|
+
}, loadConfigFromFile = async (configFilePath)=>{
|
|
342
387
|
if (isNodeVersionAtLeast(22, 18) || /\.(?:js|mjs|cjs)$/.test(configFilePath)) {
|
|
343
388
|
logger_logger.debug('loading config file with native loader:', colors.dim(configFilePath));
|
|
344
389
|
let configFileURL = pathToFileURL(configFilePath).href, exportModule = await import(`${configFileURL}?t=${Date.now()}`);
|
|
@@ -400,7 +445,7 @@ let injectToHead = (html, script)=>html.replace(/<head(\s*[^>]*)>/i, (match)=>`$
|
|
|
400
445
|
async function loadConfig({ cliOptions, command }) {
|
|
401
446
|
'build' === command ? setNodeEnv(cliOptions?.watch ? 'development' : 'production') : (setNodeEnv('development'), setDevServer(!0));
|
|
402
447
|
let root = cliOptions?.root ? node_path.resolve(cliOptions.root) : process.cwd(), configFilePath = resolveConfigPath(root, cliOptions?.config), configExport = {};
|
|
403
|
-
if (configFilePath && 'function' == typeof (configExport = await
|
|
448
|
+
if (configFilePath && 'function' == typeof (configExport = await loadConfigFromFile(configFilePath))) {
|
|
404
449
|
let params = {
|
|
405
450
|
env: getNodeEnv(),
|
|
406
451
|
command: process.argv[2]
|
|
@@ -881,7 +926,7 @@ class JsMinifyPlugin {
|
|
|
881
926
|
apply(compiler) {
|
|
882
927
|
let meta = JSON.stringify({
|
|
883
928
|
name: jsMinify_PLUGIN_NAME,
|
|
884
|
-
version: "4.
|
|
929
|
+
version: "4.4.0",
|
|
885
930
|
options: this.minifyOptions
|
|
886
931
|
});
|
|
887
932
|
compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
|
|
@@ -916,7 +961,7 @@ class JsMinifyPlugin {
|
|
|
916
961
|
}));
|
|
917
962
|
}
|
|
918
963
|
}
|
|
919
|
-
class
|
|
964
|
+
class Spinner {
|
|
920
965
|
chars = [
|
|
921
966
|
'⠋',
|
|
922
967
|
'⠙',
|
|
@@ -942,11 +987,11 @@ class LoadingAnimation {
|
|
|
942
987
|
}
|
|
943
988
|
class ProgressBar {
|
|
944
989
|
prefix = 'transforming';
|
|
945
|
-
|
|
990
|
+
spinner = new Spinner();
|
|
946
991
|
update({ current: originalCurrent, message = '' }) {
|
|
947
992
|
let { columns: terminalWidth } = process.stdout, current = originalCurrent;
|
|
948
993
|
originalCurrent >= 0.98 && (current = 1);
|
|
949
|
-
let loadingChar = this.
|
|
994
|
+
let loadingChar = this.spinner.getCurrentChar(), messageWidth = terminalWidth - this.prefix.length - (1 === current ? 10 : 9);
|
|
950
995
|
logUpdate(`${loadingChar} ${this.prefix} (${Math.floor(100 * current)}%) ${colors.dim(message.slice(0, messageWidth).padEnd(messageWidth, ' '))}`), 1 === current && clearLine();
|
|
951
996
|
}
|
|
952
997
|
}
|
|
@@ -1026,12 +1071,39 @@ let registerHooks_PLUGIN_NAME = 'RegisterHooksPlugin';
|
|
|
1026
1071
|
class RegisterHooksPlugin {
|
|
1027
1072
|
isFirstCompile = !0;
|
|
1028
1073
|
lastVirtualModules = new Map();
|
|
1074
|
+
lastLoadedModules = new Map();
|
|
1075
|
+
resolveIdTimings = new Map();
|
|
1076
|
+
loadTimings = new Map();
|
|
1029
1077
|
isCompiling = !1;
|
|
1030
1078
|
idleTimer = void 0;
|
|
1031
1079
|
apply(compiler) {
|
|
1032
1080
|
let virtualModulesPlugin = new rspack.experiments.VirtualModulesPlugin();
|
|
1033
|
-
virtualModulesPlugin.apply(compiler)
|
|
1034
|
-
|
|
1081
|
+
virtualModulesPlugin.apply(compiler);
|
|
1082
|
+
let resolveIdPlugins = getNormalizedPluginsByHook('resolveId'), loadPlugins = getNormalizedPluginsByHook('load'), resolveId = async (id, importer)=>{
|
|
1083
|
+
for (let plugin of resolveIdPlugins){
|
|
1084
|
+
let start = performance.now(), result = await plugin.resolveId(id, importer), duration = performance.now() - start;
|
|
1085
|
+
if (this.resolveIdTimings.set(plugin.name, (this.resolveIdTimings.get(plugin.name) || 0) + duration), 'string' == typeof result && result) return result;
|
|
1086
|
+
}
|
|
1087
|
+
return null;
|
|
1088
|
+
}, load = async (id)=>{
|
|
1089
|
+
for (let plugin of loadPlugins){
|
|
1090
|
+
let start = performance.now(), result = await plugin.load(id), duration = performance.now() - start;
|
|
1091
|
+
if (this.loadTimings.set(plugin.name, (this.loadTimings.get(plugin.name) || 0) + duration), 'string' == typeof result) return result;
|
|
1092
|
+
}
|
|
1093
|
+
return null;
|
|
1094
|
+
};
|
|
1095
|
+
(resolveIdPlugins.length > 0 || loadPlugins.length > 0) && compiler.hooks.normalModuleFactory.tap(registerHooks_PLUGIN_NAME, (factory)=>{
|
|
1096
|
+
factory.hooks.beforeResolve.tapPromise(registerHooks_PLUGIN_NAME, async (resolveData)=>{
|
|
1097
|
+
if (!resolveData) return;
|
|
1098
|
+
let request = resolveData.request;
|
|
1099
|
+
if (!request) return;
|
|
1100
|
+
let importer = resolveData.contextInfo?.issuer, resolvedId = await resolveId(request, importer) || request;
|
|
1101
|
+
resolvedId !== request && (resolveData.request = resolvedId);
|
|
1102
|
+
let loaded = await load(resolvedId);
|
|
1103
|
+
null !== loaded && this.lastLoadedModules.get(resolvedId) !== loaded && (this.lastLoadedModules.set(resolvedId, loaded), virtualModulesPlugin.writeModule(resolvedId, loaded));
|
|
1104
|
+
});
|
|
1105
|
+
}), compiler.hooks.compile.tap(registerHooks_PLUGIN_NAME, ()=>{
|
|
1106
|
+
this.isCompiling = !0, this.resolveIdTimings.clear(), this.loadTimings.clear(), applyPluginsByHookSync('buildStart', (impl)=>{
|
|
1035
1107
|
impl({
|
|
1036
1108
|
compiler,
|
|
1037
1109
|
isFirstCompile: this.isFirstCompile,
|
|
@@ -1039,7 +1111,12 @@ class RegisterHooksPlugin {
|
|
|
1039
1111
|
});
|
|
1040
1112
|
});
|
|
1041
1113
|
});
|
|
1042
|
-
let
|
|
1114
|
+
let updateLoadedModules = async ()=>{
|
|
1115
|
+
if (0 !== this.lastLoadedModules.size) for (let [id, prev] of this.lastLoadedModules){
|
|
1116
|
+
let loaded = await load(id);
|
|
1117
|
+
null !== loaded && prev !== loaded && (this.lastLoadedModules.set(id, loaded), virtualModulesPlugin.writeModule(id, loaded));
|
|
1118
|
+
}
|
|
1119
|
+
}, updateVirtualModules = ()=>{
|
|
1043
1120
|
applyPluginsByHookSync('virtualModules', (impl)=>{
|
|
1044
1121
|
Object.entries(impl()).forEach(([path, content])=>{
|
|
1045
1122
|
this.lastVirtualModules.get(path) !== content && (this.lastVirtualModules.set(path, content), virtualModulesPlugin.writeModule(path, content));
|
|
@@ -1069,9 +1146,12 @@ class RegisterHooksPlugin {
|
|
|
1069
1146
|
});
|
|
1070
1147
|
}), compiler.hooks.compilation.tap(registerHooks_PLUGIN_NAME, (compilation)=>{
|
|
1071
1148
|
rspack.HtmlRspackPlugin.getCompilationHooks(compilation).beforeEmit.tapPromise(registerHooks_PLUGIN_NAME, async (data)=>(await applyPluginsByHook('transformHtml', async (impl)=>{
|
|
1072
|
-
|
|
1149
|
+
let result = await impl(data.html);
|
|
1150
|
+
data.html = 'string' == typeof result ? result : applyHtmlTagDescriptors(data.html, result);
|
|
1073
1151
|
}), data));
|
|
1074
1152
|
}), compiler.hooks.finishMake.tap(registerHooks_PLUGIN_NAME, (compilation)=>{
|
|
1153
|
+
if (this.resolveIdTimings.size > 0) for (let [pluginName, total] of this.resolveIdTimings)logger_logger.debug(`${colors.magenta('[plugin]')} ${colors.cyan(pluginName)} ${colors.blue('resolveId')} ${colors.dim('in')} ${colors.yellow(`${total.toFixed(2)}ms`)}`);
|
|
1154
|
+
if (this.loadTimings.size > 0) for (let [pluginName, total] of this.loadTimings)logger_logger.debug(`${colors.magenta('[plugin]')} ${colors.cyan(pluginName)} ${colors.blue('load')} ${colors.dim('in')} ${colors.yellow(`${total.toFixed(2)}ms`)}`);
|
|
1075
1155
|
let pluginMap = transformTimingMap.get(compilation);
|
|
1076
1156
|
if (pluginMap) {
|
|
1077
1157
|
for (let [pluginName, total] of pluginMap)logger_logger.debug(`${colors.magenta('[plugin]')} ${colors.cyan(pluginName)} ${colors.blue('transform')} ${colors.dim('in')} ${colors.yellow(`${total.toFixed(2)}ms`)}`);
|
|
@@ -1088,7 +1168,7 @@ class RegisterHooksPlugin {
|
|
|
1088
1168
|
}), this.isFirstCompile = !1;
|
|
1089
1169
|
}), compiler.hooks.afterDone.tap(registerHooks_PLUGIN_NAME, ()=>{
|
|
1090
1170
|
this.isCompiling = !1, isDev() && (clearTimeout(this.idleTimer), this.idleTimer = setTimeout(()=>{
|
|
1091
|
-
this.isCompiling || updateVirtualModules();
|
|
1171
|
+
this.isCompiling || (updateVirtualModules(), updateLoadedModules());
|
|
1092
1172
|
}, 50));
|
|
1093
1173
|
});
|
|
1094
1174
|
}
|
|
@@ -1245,10 +1325,6 @@ async function getBundlerConfig(originalUnpackConfig) {
|
|
|
1245
1325
|
...publicVars,
|
|
1246
1326
|
...unpackConfig.define
|
|
1247
1327
|
}),
|
|
1248
|
-
unpackConfig.performance?.removeMomentLocale && new rspack.IgnorePlugin({
|
|
1249
|
-
resourceRegExp: /^\.\/locale$/,
|
|
1250
|
-
contextRegExp: /moment$/
|
|
1251
|
-
}),
|
|
1252
1328
|
unpackConfig.build?.copy && new rspack.CopyRspackPlugin({
|
|
1253
1329
|
patterns: unpackConfig.build.copy
|
|
1254
1330
|
}),
|
|
@@ -1763,7 +1839,7 @@ async function unpackDev(unpackConfig) {
|
|
|
1763
1839
|
...middlewares
|
|
1764
1840
|
]);
|
|
1765
1841
|
let server = new RspackDevServer(devServerOptions, compiler);
|
|
1766
|
-
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.
|
|
1842
|
+
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.4.0`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - getUnpackStartTime()))} ${colors.dim('ms')}\n`), printServerUrls({
|
|
1767
1843
|
port,
|
|
1768
1844
|
host: unpackConfig.server.host,
|
|
1769
1845
|
base: unpackConfig.base
|
|
@@ -1777,10 +1853,10 @@ async function unpackDev(unpackConfig) {
|
|
|
1777
1853
|
function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'unpack' }) {
|
|
1778
1854
|
let _context = {
|
|
1779
1855
|
callerName,
|
|
1780
|
-
version: "4.
|
|
1856
|
+
version: "4.4.0",
|
|
1781
1857
|
cachePath: 'node_modules/.unpack'
|
|
1782
1858
|
}, resolveConfig = (mode)=>{
|
|
1783
|
-
let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, root, alias, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, plugin, root1, uno, generated, configOrPathFromUnpackConfig, defaultsFromUnpackConfig, VIRTUAL_UNO_CSS_ID, rootDir, isMpa, unoConfig, configFilePath, unpackConfigPath, tokens, requestedLayers, tasks, unocssCacheDir, tokensCachePath, layersCachePath, timeCachePath, configHashCachePath, generatedCachePath, bundlerCacheDir, cachedTokensSize, cachedLayersSize, isCompiling, resolveUnocssConfig, flushTasks, getVirtualModuleContent, hash, restoreSkipCode, applyUnoTransformers,
|
|
1859
|
+
let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, root, alias, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, plugin, root1, uno, generated, configOrPathFromUnpackConfig, defaultsFromUnpackConfig, VIRTUAL_UNO_CSS_ID, rootDir, isMpa, unoConfig, configFilePath, unpackConfigPath, tokens, requestedLayers, tasks, unocssCacheDir, tokensCachePath, layersCachePath, timeCachePath, configHashCachePath, generatedCachePath, bundlerCacheDir, cachedTokensSize, cachedLayersSize, isCompiling, resolveUnocssConfig, flushTasks, getVirtualModuleContent, hash, restoreSkipCode, applyUnoTransformers, optionsFromUnpackConfig, rootPath1, registerCode, namesCode, defaultConfig = {
|
|
1784
1860
|
root: cwd,
|
|
1785
1861
|
base: '/',
|
|
1786
1862
|
sourceMap: 'production' !== mode && 'cheap-module-source-map',
|
|
@@ -1930,8 +2006,10 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
1930
2006
|
configResolved: (config)=>{
|
|
1931
2007
|
rootPath = config.root, outputPath = node_path.join(rootPath, config.build.outDir), basePath = normalizePublicPath(config.base);
|
|
1932
2008
|
},
|
|
1933
|
-
transformHtml: (
|
|
1934
|
-
|
|
2009
|
+
transformHtml: ()=>[
|
|
2010
|
+
{
|
|
2011
|
+
tag: "script",
|
|
2012
|
+
children: `;(() => {
|
|
1935
2013
|
if (typeof window === 'undefined' || typeof console === 'undefined') return
|
|
1936
2014
|
const endpoint = '${BROWSER_LOGS_ENDPOINT}'
|
|
1937
2015
|
const levels = ['error', 'warn', 'debug']
|
|
@@ -2008,7 +2086,9 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2008
2086
|
send('error', [event.reason])
|
|
2009
2087
|
})
|
|
2010
2088
|
})()
|
|
2011
|
-
|
|
2089
|
+
`
|
|
2090
|
+
}
|
|
2091
|
+
],
|
|
2012
2092
|
setupMiddlewares: (middlewares)=>[
|
|
2013
2093
|
(req, res, next)=>{
|
|
2014
2094
|
if ('POST' !== req.method || !req.url?.startsWith(BROWSER_LOGS_ENDPOINT)) return next();
|
|
@@ -2408,7 +2488,13 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2408
2488
|
}) : null
|
|
2409
2489
|
}), config;
|
|
2410
2490
|
},
|
|
2411
|
-
transformHtml: (
|
|
2491
|
+
transformHtml: ()=>preJsAssets.sort((a, b)=>a.order - b.order).map((item)=>item.path).map((src)=>({
|
|
2492
|
+
tag: "script",
|
|
2493
|
+
attrs: {
|
|
2494
|
+
defer: !0,
|
|
2495
|
+
src
|
|
2496
|
+
}
|
|
2497
|
+
})),
|
|
2412
2498
|
setupMiddlewares: (middlewares)=>[
|
|
2413
2499
|
(req, res, next)=>{
|
|
2414
2500
|
if ('string' != typeof req.url) return void next();
|
|
@@ -2528,10 +2614,10 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2528
2614
|
let configFile = node_path.join(root, file);
|
|
2529
2615
|
if (node_fs.existsSync(configFile)) return configFile;
|
|
2530
2616
|
}
|
|
2531
|
-
})(rootDir, configFilePath), configFromOption = mergeConfig(configFromOption, await
|
|
2617
|
+
})(rootDir, configFilePath), configFromOption = mergeConfig(configFromOption, await loadConfigFromFile(configFilePath)), resolvedDefaults && (configFromOption = mergeConfig(resolvedDefaults, configFromOption)), configFromOption;
|
|
2532
2618
|
}, flushTasks = async ()=>{
|
|
2533
2619
|
if (!tasks.length) return;
|
|
2534
|
-
logger_logger.debug(colors.yellow(`[unocss] Extract token from ${tasks.length}
|
|
2620
|
+
logger_logger.debug(colors.yellow(`[unocss] Extract token from ${tasks.length} modules.`));
|
|
2535
2621
|
let pending = tasks.map((t)=>t());
|
|
2536
2622
|
tasks = [], await Promise.all(pending);
|
|
2537
2623
|
}, getVirtualModuleContent = (layer)=>{
|
|
@@ -2563,7 +2649,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2563
2649
|
invalidate: ()=>{}
|
|
2564
2650
|
}), s.hasChanged() && (s = new magic_string(code = restoreSkipCode(s.toString(), skipMap))));
|
|
2565
2651
|
return code !== original ? code : null;
|
|
2566
|
-
},
|
|
2652
|
+
}, {
|
|
2567
2653
|
name: 'unpack:unocss',
|
|
2568
2654
|
apply: (config)=>!!config.css?.unocss,
|
|
2569
2655
|
configResolved: async (config, { cachePath })=>{
|
|
@@ -2583,7 +2669,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2583
2669
|
return;
|
|
2584
2670
|
}
|
|
2585
2671
|
let cachedTime = Number(node_fs.readFileSync(timeCachePath, 'utf-8').trim()), cachedHash = node_fs.readFileSync(configHashCachePath, 'utf-8').trim(), isExpired = now - cachedTime >= 604800000, isHashChanged = cachedHash !== nextHash;
|
|
2586
|
-
(isExpired || isHashChanged) && (isExpired && logger_logger.debug(colors.yellow('[unocss] Cache expired.')), isHashChanged && logger_logger.debug(colors.yellow('[unocss] Cache invalidated
|
|
2672
|
+
(isExpired || isHashChanged) && (isExpired && logger_logger.debug(colors.yellow('[unocss] Cache expired.')), isHashChanged && logger_logger.debug(colors.yellow('[unocss] Cache invalidated.')), removeDir(unocssCacheDir), removeDir(bundlerCacheDir), ensureDir(unocssCacheDir), node_fs.writeFileSync(timeCachePath, String(now), 'utf-8'), node_fs.writeFileSync(configHashCachePath, nextHash, 'utf-8'));
|
|
2587
2673
|
})(), (()=>{
|
|
2588
2674
|
if (node_fs.existsSync(tokensCachePath)) {
|
|
2589
2675
|
let cached = JSON.parse(node_fs.readFileSync(tokensCachePath, 'utf-8'));
|
|
@@ -2648,7 +2734,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2648
2734
|
if (await flushTasks(), !generated || generated.meta.tokensSize !== tokens.size || generated.meta.layersSize !== requestedLayers.size) {
|
|
2649
2735
|
let result = await uno.generate(tokens, {
|
|
2650
2736
|
minify: !0
|
|
2651
|
-
}), customLayers =
|
|
2737
|
+
}), customLayers = Array.from(requestedLayers).filter((layer)=>layer !== LAYER_MARK_ALL);
|
|
2652
2738
|
generated = {
|
|
2653
2739
|
meta: {
|
|
2654
2740
|
tokensSize: tokens.size,
|
|
@@ -2671,10 +2757,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2671
2757
|
}
|
|
2672
2758
|
}
|
|
2673
2759
|
},
|
|
2674
|
-
|
|
2675
|
-
[VIRTUAL_UNO_CSS_ID]: getVirtualModuleContent(LAYER_MARK_ALL),
|
|
2676
|
-
...getCustomLayers().reduce((acc, layer)=>(acc[`uno:${layer}.css`] = getVirtualModuleContent(layer), acc), {})
|
|
2677
|
-
})
|
|
2760
|
+
load: (id)=>id === VIRTUAL_UNO_CSS_ID ? getVirtualModuleContent(LAYER_MARK_ALL) : id.startsWith('uno:') ? getVirtualModuleContent(id.slice(4, -4)) : null
|
|
2678
2761
|
}),
|
|
2679
2762
|
(rootPath1 = '', registerCode = '', namesCode = '', {
|
|
2680
2763
|
name: 'unpack:svg-icons',
|
|
@@ -2695,16 +2778,8 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2695
2778
|
registerCode = `const svgDomId = ${JSON.stringify(domId)}\nconst svgHtml = ${JSON.stringify(svg)}\nconst inject = (position) => {\n if (typeof document === 'undefined') return\n if (document.getElementById(svgDomId)) return\n const div = document.createElement('div')\n div.innerHTML = svgHtml\n const svgEl = div.firstElementChild\n if (!svgEl) return\n if (position === 'head' && document.head) {\n document.head.prepend(svgEl)\n return\n }\n const body = document.body\n if (!body) return\n if (position === 'body-first' && body.firstChild) {\n body.insertBefore(svgEl, body.firstChild)\n } else {\n body.appendChild(svgEl)\n }\n}\nconst mount = () => inject(${JSON.stringify(inject)})\nif (typeof document !== 'undefined') {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', mount)\n } else {\n mount()\n }\n}\nexport default mount`, namesCode = `export const svgIconNames = ${JSON.stringify(names)}\nexport default svgIconNames`;
|
|
2696
2779
|
})();
|
|
2697
2780
|
},
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
'~svg-icons-names': namesCode || 'export default []'
|
|
2701
|
-
}),
|
|
2702
|
-
transform: {
|
|
2703
|
-
filter: {
|
|
2704
|
-
test: JS_REGEX
|
|
2705
|
-
},
|
|
2706
|
-
handler: (code)=>code.includes('virtual:svg-icons-') ? code.replace('virtual:svg-icons-', '~svg-icons-') : null
|
|
2707
|
-
}
|
|
2781
|
+
resolveId: (id)=>id.startsWith('virtual:svg-icons-') ? '\0' + id : null,
|
|
2782
|
+
load: (id)=>'\0virtual:svg-icons-register' === id ? registerCode || 'export default null' : '\0virtual:svg-icons-names' === id ? namesCode || 'export default []' : null
|
|
2708
2783
|
})
|
|
2709
2784
|
]
|
|
2710
2785
|
};
|
|
@@ -2718,7 +2793,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
2718
2793
|
let mode = watch ? 'development' : 'production';
|
|
2719
2794
|
setNodeEnv(mode);
|
|
2720
2795
|
let config = resolveConfig(mode);
|
|
2721
|
-
console.log(colors.brand(`${callerName} v4.
|
|
2796
|
+
console.log(colors.brand(`${callerName} v4.4.0`), colors.cyan(`building for ${mode}...`)), await unpackBuild(config);
|
|
2722
2797
|
},
|
|
2723
2798
|
dev: async ()=>{
|
|
2724
2799
|
setUnpackStartTime(performance.now());
|
|
@@ -2867,7 +2942,7 @@ function runCLI() {
|
|
|
2867
2942
|
logger_logger.clear(), logger_logger.info(`${node_path.basename(file)} changed, restarting server...`), await watcher.close(), await cleanUpBeforeRestart(), startServer(options);
|
|
2868
2943
|
});
|
|
2869
2944
|
});
|
|
2870
|
-
devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.
|
|
2945
|
+
devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.4.0"), cli.parse();
|
|
2871
2946
|
}
|
|
2872
2947
|
var src_CSS_MODULES_NAMED_EXPORT = !1;
|
|
2873
|
-
export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, DEV_DEFAULT_FILENAME, JSX_REGEX, JS_REGEX, LOCALHOST, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, SCRIPT_REGEX, TEMPLATE_CONTENT, addRestartCleaner, cleanUpBeforeRestart, clearLine, colors, convertBasicAnsiColors, createChokidar, createUnpack, debounce, defineConfig, emptyDir, ensureDir, esVersionToBrowserslist, external_tinyglobby_glob as glob, findExists, getAddressUrls, getCompiledPkgPath, getCurrentUnpackConfig, getFilesContentHash, getHtmlTemplateOrContent, getIpv4Interfaces, getNodeEnv, getOrSetDefault, getPathInJs, getPort, getTime, getUnpackStartTime, getUserDepPath, getUserDepVersion, globSync,
|
|
2948
|
+
export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, DEV_DEFAULT_FILENAME, JSX_REGEX, JS_REGEX, LOCALHOST, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, SCRIPT_REGEX, TEMPLATE_CONTENT, addRestartCleaner, applyHtmlTagDescriptors, cleanUpBeforeRestart, clearLine, colors, convertBasicAnsiColors, createChokidar, createUnpack, debounce, defineConfig, emptyDir, ensureDir, esVersionToBrowserslist, external_tinyglobby_glob as glob, findExists, getAddressUrls, getCompiledPkgPath, getCurrentUnpackConfig, getFilesContentHash, getHtmlTemplateOrContent, getIpv4Interfaces, getNodeEnv, getOrSetDefault, getPathInJs, getPort, getTime, getUnpackStartTime, getUserDepPath, getUserDepVersion, globSync, isBoolean, isDebug, isDev, isEmptyDir, isFileExists, isFileSync, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isRegExp, isString, isUndefined, isWin, launchEditor, loadConfig, loadConfigFromFile, logUpdate, logger_LogColor as LogColor, logger_logger as logger, mergeConfig, normalizePublicPath, openBrowser, pLimit, pathExists, pathToExportIdentifier, prettyTime, printServerUrls, removeDir, renderHtmlTagDescriptor, resolveConfigPath, rspack, runCLI, set, setCurrentUnpackConfig, setDevServer, setNodeEnv, setUnpackStartTime, src_CSS_MODULES_NAMED_EXPORT as CSS_MODULES_NAMED_EXPORT, trackPerformance, utils_isDevServer as isDevServer, utils_isProd as isProd };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundlerConfig, UnpackConfig } from '../types';
|
|
2
2
|
export declare function applyBuildAnalyzeConfig({ config, unpackConfig, }: {
|
|
3
|
-
config:
|
|
3
|
+
config: BundlerConfig;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
|
-
}): Promise<
|
|
5
|
+
}): Promise<BundlerConfig>;
|
|
6
6
|
//# sourceMappingURL=buildAnalyze.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildAnalyze.d.ts","sourceRoot":"","sources":["../../src/bundler-config/buildAnalyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"buildAnalyze.d.ts","sourceRoot":"","sources":["../../src/bundler-config/buildAnalyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG5D,wBAAsB,uBAAuB,CAAC,EAC5C,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBzB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundlerConfig, UnpackConfig } from '../types';
|
|
2
2
|
export declare function applyCacheConfig({ config, unpackConfig, envFilePaths, }: {
|
|
3
|
-
config:
|
|
3
|
+
config: BundlerConfig;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
5
|
envFilePaths: string[];
|
|
6
|
-
}): Promise<
|
|
6
|
+
}): Promise<BundlerConfig>;
|
|
7
7
|
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/bundler-config/cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/bundler-config/cache.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAoC5D,wBAAsB,gBAAgB,CAAC,EACrC,MAAM,EACN,YAAY,EACZ,YAAY,GACb,EAAE;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,YAAY,CAAA;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAA;CACvB,GAAG,OAAO,CAAC,aAAa,CAAC,CA0BzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundlerConfig, UnpackConfig } from '../types';
|
|
2
2
|
export declare const applyChunkSplitConfig: ({ config, unpackConfig, }: {
|
|
3
|
-
config:
|
|
3
|
+
config: BundlerConfig;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
|
-
}) =>
|
|
5
|
+
}) => BundlerConfig;
|
|
6
6
|
//# sourceMappingURL=chunkSplit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunkSplit.d.ts","sourceRoot":"","sources":["../../src/bundler-config/chunkSplit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"chunkSplit.d.ts","sourceRoot":"","sources":["../../src/bundler-config/chunkSplit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EAKb,YAAY,EACb,MAAM,WAAW,CAAA;AA4KlB,eAAO,MAAM,qBAAqB,GAAI,2BAGnC;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,YAAY,CAAA;CAC3B,KAAG,aAkBH,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundlerConfig, UnpackConfig } from '../types';
|
|
2
2
|
export declare function applyCssConfig({ config, unpackConfig, }: {
|
|
3
|
-
config:
|
|
3
|
+
config: BundlerConfig;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
|
-
}):
|
|
5
|
+
}): BundlerConfig;
|
|
6
6
|
//# sourceMappingURL=css.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/bundler-config/css.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/bundler-config/css.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAU,YAAY,EAAE,MAAM,WAAW,CAAA;AAWpE,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,aAAa,CAqHhB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundlerConfig, UnpackConfig } from '../types';
|
|
2
2
|
export declare function applyDetectCircularConfig({ config, unpackConfig, }: {
|
|
3
|
-
config:
|
|
3
|
+
config: BundlerConfig;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
|
-
}):
|
|
5
|
+
}): BundlerConfig;
|
|
6
6
|
//# sourceMappingURL=detectCircular.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detectCircular.d.ts","sourceRoot":"","sources":["../../src/bundler-config/detectCircular.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"detectCircular.d.ts","sourceRoot":"","sources":["../../src/bundler-config/detectCircular.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAyB5D,wBAAgB,yBAAyB,CAAC,EACxC,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,aAAa,CAwChB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundlerConfig, UnpackConfig } from '../types';
|
|
2
2
|
export declare function applyHtmlConfig({ config, unpackConfig, }: {
|
|
3
|
-
config:
|
|
3
|
+
config: BundlerConfig;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
|
-
}): Promise<
|
|
5
|
+
}): Promise<BundlerConfig>;
|
|
6
6
|
//# sourceMappingURL=html.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/bundler-config/html.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../src/bundler-config/html.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG5D,wBAAsB,eAAe,CAAC,EACpC,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,OAAO,CAAC,aAAa,CAAC,CA2BzB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function getBundlerConfig(originalUnpackConfig: UnpackConfig): Promise<
|
|
1
|
+
import type { BundlerConfig, UnpackConfig } from '../types';
|
|
2
|
+
export declare function getBundlerConfig(originalUnpackConfig: UnpackConfig): Promise<BundlerConfig>;
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAwB5D,wBAAsB,gBAAgB,CAAC,oBAAoB,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC,CAgNjG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundlerConfig, UnpackConfig } from '../types';
|
|
2
2
|
export declare function applyNativeCssConfig({ config, unpackConfig, }: {
|
|
3
|
-
config:
|
|
3
|
+
config: BundlerConfig;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
|
-
}):
|
|
5
|
+
}): BundlerConfig;
|
|
6
6
|
//# sourceMappingURL=nativeCss.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeCss.d.ts","sourceRoot":"","sources":["../../src/bundler-config/nativeCss.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"nativeCss.d.ts","sourceRoot":"","sources":["../../src/bundler-config/nativeCss.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAU,YAAY,EAAE,MAAM,WAAW,CAAA;AAWpE,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,aAAa,CA0HhB"}
|
|
@@ -2,6 +2,9 @@ import type { Rspack } from '../../types';
|
|
|
2
2
|
export declare class RegisterHooksPlugin {
|
|
3
3
|
private isFirstCompile;
|
|
4
4
|
private lastVirtualModules;
|
|
5
|
+
private lastLoadedModules;
|
|
6
|
+
private resolveIdTimings;
|
|
7
|
+
private loadTimings;
|
|
5
8
|
private isCompiling;
|
|
6
9
|
private idleTimer;
|
|
7
10
|
apply(compiler: Rspack.Compiler): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerHooks.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/plugins/registerHooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registerHooks.d.ts","sourceRoot":"","sources":["../../../src/bundler-config/plugins/registerHooks.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAIvC,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,cAAc,CAAO;IAC7B,OAAO,CAAC,kBAAkB,CAA4B;IACtD,OAAO,CAAC,iBAAiB,CAA4B;IACrD,OAAO,CAAC,gBAAgB,CAA4B;IACpD,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,SAAS,CAAwC;IACzD,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,GAAG,IAAI;CAyJvC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BundlerConfig, UnpackConfig } from '../types';
|
|
2
2
|
export declare function applyTypeCheckConfig({ config, unpackConfig, }: {
|
|
3
|
-
config:
|
|
3
|
+
config: BundlerConfig;
|
|
4
4
|
unpackConfig: UnpackConfig;
|
|
5
|
-
}): Promise<
|
|
5
|
+
}): Promise<BundlerConfig>;
|
|
6
6
|
//# sourceMappingURL=typeCheck.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeCheck.d.ts","sourceRoot":"","sources":["../../src/bundler-config/typeCheck.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"typeCheck.d.ts","sourceRoot":"","sources":["../../src/bundler-config/typeCheck.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE5D,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,aAAa,CAAA;IACrB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,OAAO,CAAC,aAAa,CAAC,CAwCzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserLogs.d.ts","sourceRoot":"","sources":["../../src/plugins/browserLogs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"browserLogs.d.ts","sourceRoot":"","sources":["../../src/plugins/browserLogs.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAoB,YAAY,EAAE,MAAM,WAAW,CAAA;AA6B/D,eAAO,MAAM,iBAAiB,QAAO,YAoZpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebundle.d.ts","sourceRoot":"","sources":["../../src/plugins/prebundle.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"prebundle.d.ts","sourceRoot":"","sources":["../../src/plugins/prebundle.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAA0C,YAAY,EAAE,MAAM,WAAW,CAAA;AAkGrF,eAAO,MAAM,eAAe,QAAO,YAqZlC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svgIcons.d.ts","sourceRoot":"","sources":["../../src/plugins/svgIcons.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"svgIcons.d.ts","sourceRoot":"","sources":["../../src/plugins/svgIcons.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC,CAAA;IAChE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,MAAM,CAAA;CAC7C,CAAA;AAwID,eAAO,MAAM,cAAc,GAAI,UAAU,qBAAqB,KAAG,YAoChE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unocss.d.ts","sourceRoot":"","sources":["../../src/plugins/unocss.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIV,UAAU,EACV,kBAAkB,EACnB,MAAM,cAAc,CAAA;AAOrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAU7C,MAAM,MAAM,mBAAmB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,CAAA;AAClF,MAAM,MAAM,oBAAoB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAA;AAoE3F,eAAO,MAAM,YAAY,GAAI,KAAK,SAAS,MAAM,EAC/C,eAAe,mBAAmB,CAAC,KAAK,CAAC,GAAG,MAAM,EAClD,WAAW,oBAAoB,CAAC,KAAK,CAAC,KACrC,
|
|
1
|
+
{"version":3,"file":"unocss.d.ts","sourceRoot":"","sources":["../../src/plugins/unocss.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAIV,UAAU,EACV,kBAAkB,EACnB,MAAM,cAAc,CAAA;AAOrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAU7C,MAAM,MAAM,mBAAmB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,CAAA;AAClF,MAAM,MAAM,oBAAoB,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAA;AAoE3F,eAAO,MAAM,YAAY,GAAI,KAAK,SAAS,MAAM,EAC/C,eAAe,mBAAmB,CAAC,KAAK,CAAC,GAAG,MAAM,EAClD,WAAW,oBAAoB,CAAC,KAAK,CAAC,KACrC,YA+VF,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Spinner } from './spinner';
|
|
2
2
|
export declare class ProgressBar {
|
|
3
3
|
prefix: string;
|
|
4
|
-
|
|
4
|
+
spinner: Spinner;
|
|
5
5
|
update({ current: originalCurrent, message }: {
|
|
6
6
|
current: number;
|
|
7
7
|
message?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressBar.d.ts","sourceRoot":"","sources":["../src/progressBar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"progressBar.d.ts","sourceRoot":"","sources":["../src/progressBar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,qBAAa,WAAW;IACtB,MAAM,SAAiB;IACvB,OAAO,UAAgB;IAEvB,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,OAAY,EAAE,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE;CAiBzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/run/dev.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/run/dev.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAmC,YAAY,EAAE,MAAM,WAAW,CAAA;AAI9E,wBAAsB,SAAS,CAC7B,YAAY,EAAE,YAAY,GACzB,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAsFxC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare class
|
|
1
|
+
export declare class Spinner {
|
|
2
2
|
private chars;
|
|
3
3
|
private currentIndex;
|
|
4
4
|
private lastUpdateTime;
|
|
@@ -6,4 +6,4 @@ export declare class LoadingAnimation {
|
|
|
6
6
|
getCurrentChar(): string;
|
|
7
7
|
reset(): void;
|
|
8
8
|
}
|
|
9
|
-
//# sourceMappingURL=
|
|
9
|
+
//# sourceMappingURL=spinner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../src/spinner.ts"],"names":[],"mappings":"AAAA,qBAAa,OAAO;IAClB,OAAO,CAAC,KAAK,CAA+D;IAC5E,OAAO,CAAC,YAAY,CAAI;IACxB,OAAO,CAAC,cAAc,CAAI;IAC1B,OAAO,CAAC,QAAQ,CAAM;IAEtB,cAAc,IAAI,MAAM;IASxB,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type SplitChunks = false | OptimizationSplitChunksOptions;
|
|
3
|
-
export type CacheGroups = Record<string, OptimizationSplitChunksCacheGroup>;
|
|
1
|
+
import type { Rspack } from './rspack';
|
|
2
|
+
export type SplitChunks = false | Rspack.OptimizationSplitChunksOptions;
|
|
3
|
+
export type CacheGroups = Record<string, Rspack.OptimizationSplitChunksCacheGroup>;
|
|
4
4
|
export type ForceSplitting = RegExp[] | Record<string, RegExp>;
|
|
5
5
|
export type ChunkSplitStrategy = 'split-by-module' | 'all-in-one' | 'single-vendor' | 'split-by-size' | 'custom';
|
|
6
6
|
export interface BaseSplitRules {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunkSplit.d.ts","sourceRoot":"","sources":["../../src/types/chunkSplit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"chunkSplit.d.ts","sourceRoot":"","sources":["../../src/types/chunkSplit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEtC,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,CAAC,8BAA8B,CAAA;AACvE,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,iCAAiC,CAAC,CAAA;AAElF,MAAM,MAAM,cAAc,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAE9D,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,YAAY,GACZ,eAAe,GACf,eAAe,GACf,QAAQ,CAAA;AAEZ,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,kBAAkB,CAAA;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAA;CAChC;AAED,MAAM,WAAW,cAAe,SAAQ,cAAc;IACpD,QAAQ,CAAC,EAAE,OAAO,CAAC,kBAAkB,EAAE,eAAe,GAAG,QAAQ,CAAC,CAAA;CACnE;AAED,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,QAAQ,EAAE,eAAe,CAAA;IACzB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,QAAQ,EAAE,QAAQ,CAAA;IAClB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED,MAAM,MAAM,UAAU,GAAG,cAAc,GAAG,WAAW,GAAG,WAAW,CAAA"}
|