@unpackjs/core 3.3.6 → 3.3.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/dist/index.cjs
CHANGED
|
@@ -723,7 +723,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
723
723
|
apply(compiler) {
|
|
724
724
|
let meta = JSON.stringify({
|
|
725
725
|
name: jsMinify_PLUGIN_NAME,
|
|
726
|
-
version: "3.3.
|
|
726
|
+
version: "3.3.7",
|
|
727
727
|
options: this.minifyOptions
|
|
728
728
|
});
|
|
729
729
|
compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
|
|
@@ -944,16 +944,16 @@ for(var __webpack_i__ in (()=>{
|
|
|
944
944
|
}).join(', ');
|
|
945
945
|
return files.length > 1 ? `${fileInfo} and ${files.length - 1} more` : fileInfo;
|
|
946
946
|
}
|
|
947
|
-
let
|
|
948
|
-
async function compileDone(compiler, stats) {
|
|
949
|
-
let compileTime = stats.toJson({
|
|
947
|
+
let getCompileTime = (stats)=>stats.toJson({
|
|
950
948
|
preset: 'errors-only',
|
|
951
949
|
timings: !0
|
|
952
|
-
}).time / 1000,
|
|
950
|
+
}).time / 1000, sameCount = 0;
|
|
951
|
+
async function compileDone(compiler, stats) {
|
|
952
|
+
let root = compiler.options.context;
|
|
953
953
|
if (!stats.hasErrors()) if (isProd()) isCI() || await printFileSize({
|
|
954
954
|
root,
|
|
955
955
|
stats
|
|
956
|
-
}), logger_logger.ready(colors.green(`built in ${prettyTime(
|
|
956
|
+
}), logger_logger.ready(colors.green(`built in ${prettyTime(getCompileTime(stats))}`));
|
|
957
957
|
else {
|
|
958
958
|
let changedFiles = compiler.modifiedFiles ? Array.from(compiler.modifiedFiles) : null, fileInfo = function(changedFiles, removedFiles, root) {
|
|
959
959
|
if (!changedFiles?.length && !removedFiles?.length) return null;
|
|
@@ -977,7 +977,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
977
977
|
logger_logger.debug(`${colors.cyan(packageName)}: ${colors.yellow(count)} modules`);
|
|
978
978
|
});
|
|
979
979
|
}
|
|
980
|
-
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(
|
|
980
|
+
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(getCompileTime(stats))} (${stats.compilation.modules.size} modules)`) : '');
|
|
981
981
|
}
|
|
982
982
|
}
|
|
983
983
|
let progress_PLUGIN_NAME = 'ProgressPlugin';
|
|
@@ -1234,7 +1234,10 @@ for(var __webpack_i__ in (()=>{
|
|
|
1234
1234
|
]
|
|
1235
1235
|
},
|
|
1236
1236
|
watchOptions: {
|
|
1237
|
-
|
|
1237
|
+
aggregateTimeout: 0
|
|
1238
|
+
},
|
|
1239
|
+
performance: {
|
|
1240
|
+
hints: !1
|
|
1238
1241
|
}
|
|
1239
1242
|
};
|
|
1240
1243
|
for (let plugin of (config = (({ config, unpackConfig })=>{
|
|
@@ -1905,7 +1908,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1905
1908
|
req.headers.accept?.includes('html') && (req.url = '/index.html'), next();
|
|
1906
1909
|
}), middlewares.unshift(core_namespaceObject.experiments.lazyCompilationMiddleware(compiler)), middlewares);
|
|
1907
1910
|
let server = new dev_server_namespaceObject.RspackDevServer(devServerOptions, compiler);
|
|
1908
|
-
await server.start(), logger_logger.greet(` ${colors.green(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v3.3.
|
|
1911
|
+
await server.start(), logger_logger.greet(` ${colors.green(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v3.3.7`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - global.__unpack_start_time))} ms\n`), printAddressUrls(port, unpackConfig.server?.host), addRestartCleaner(()=>server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())));
|
|
1909
1912
|
let open = unpackConfig.server?.open, url = isString(open) ? open : `http://localhost:${port}`;
|
|
1910
1913
|
open && openBrowser(url), setupCliShortcuts({
|
|
1911
1914
|
openPage: async ()=>{
|
|
@@ -1978,7 +1981,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1978
1981
|
...mergeConfig(defaultConfig, config),
|
|
1979
1982
|
_context: {
|
|
1980
1983
|
callerName,
|
|
1981
|
-
version: "3.3.
|
|
1984
|
+
version: "3.3.7"
|
|
1982
1985
|
}
|
|
1983
1986
|
};
|
|
1984
1987
|
};
|
|
@@ -1986,7 +1989,7 @@ for(var __webpack_i__ in (()=>{
|
|
|
1986
1989
|
build: async ({ watch } = {})=>{
|
|
1987
1990
|
setNodeEnv(watch ? 'development' : 'production');
|
|
1988
1991
|
let config = resolveConfig();
|
|
1989
|
-
console.log(colors.rainbow(`${callerName} v3.3.
|
|
1992
|
+
console.log(colors.rainbow(`${callerName} v3.3.7`), colors.green(`building for ${getNodeEnv()}...`)), await unpackBuild(config);
|
|
1990
1993
|
},
|
|
1991
1994
|
dev: async ()=>{
|
|
1992
1995
|
global.__unpack_start_time = performance.now(), setNodeEnv('development'), setDevServer(!0);
|
package/dist/index.js
CHANGED
|
@@ -639,7 +639,7 @@ class JsMinifyPlugin {
|
|
|
639
639
|
apply(compiler) {
|
|
640
640
|
let meta = JSON.stringify({
|
|
641
641
|
name: jsMinify_PLUGIN_NAME,
|
|
642
|
-
version: "3.3.
|
|
642
|
+
version: "3.3.7",
|
|
643
643
|
options: this.minifyOptions
|
|
644
644
|
});
|
|
645
645
|
compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
|
|
@@ -857,16 +857,16 @@ function formatFileList(paths, rootPath) {
|
|
|
857
857
|
}).join(', ');
|
|
858
858
|
return files.length > 1 ? `${fileInfo} and ${files.length - 1} more` : fileInfo;
|
|
859
859
|
}
|
|
860
|
-
let
|
|
861
|
-
async function compileDone(compiler, stats) {
|
|
862
|
-
let compileTime = stats.toJson({
|
|
860
|
+
let getCompileTime = (stats)=>stats.toJson({
|
|
863
861
|
preset: 'errors-only',
|
|
864
862
|
timings: !0
|
|
865
|
-
}).time / 1000,
|
|
863
|
+
}).time / 1000, sameCount = 0;
|
|
864
|
+
async function compileDone(compiler, stats) {
|
|
865
|
+
let root = compiler.options.context;
|
|
866
866
|
if (!stats.hasErrors()) if (isProd()) isCI() || await printFileSize({
|
|
867
867
|
root,
|
|
868
868
|
stats
|
|
869
|
-
}), logger_logger.ready(colors.green(`built in ${prettyTime(
|
|
869
|
+
}), logger_logger.ready(colors.green(`built in ${prettyTime(getCompileTime(stats))}`));
|
|
870
870
|
else {
|
|
871
871
|
let fileInfo = function(changedFiles, removedFiles, root) {
|
|
872
872
|
if (!changedFiles?.length && !removedFiles?.length) return null;
|
|
@@ -890,7 +890,7 @@ async function compileDone(compiler, stats) {
|
|
|
890
890
|
logger_logger.debug(`${colors.cyan(packageName)}: ${colors.yellow(count)} modules`);
|
|
891
891
|
});
|
|
892
892
|
}
|
|
893
|
-
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(
|
|
893
|
+
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(getCompileTime(stats))} (${stats.compilation.modules.size} modules)`) : '');
|
|
894
894
|
}
|
|
895
895
|
}
|
|
896
896
|
let progress_PLUGIN_NAME = 'ProgressPlugin';
|
|
@@ -1146,7 +1146,10 @@ async function getBundlerConfig(originalUnpackConfig) {
|
|
|
1146
1146
|
]
|
|
1147
1147
|
},
|
|
1148
1148
|
watchOptions: {
|
|
1149
|
-
|
|
1149
|
+
aggregateTimeout: 0
|
|
1150
|
+
},
|
|
1151
|
+
performance: {
|
|
1152
|
+
hints: !1
|
|
1150
1153
|
}
|
|
1151
1154
|
};
|
|
1152
1155
|
for (let plugin of (config = (({ config, unpackConfig })=>{
|
|
@@ -1815,7 +1818,7 @@ async function unpackDev(originalUnpackConfig) {
|
|
|
1815
1818
|
req.headers.accept?.includes('html') && (req.url = '/index.html'), next();
|
|
1816
1819
|
}), middlewares.unshift(experiments.lazyCompilationMiddleware(compiler)), middlewares);
|
|
1817
1820
|
let server = new RspackDevServer(devServerOptions, compiler);
|
|
1818
|
-
await server.start(), logger_logger.greet(` ${colors.green(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v3.3.
|
|
1821
|
+
await server.start(), logger_logger.greet(` ${colors.green(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v3.3.7`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - global.__unpack_start_time))} ms\n`), printAddressUrls(port, unpackConfig.server?.host), addRestartCleaner(()=>server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())));
|
|
1819
1822
|
let open = unpackConfig.server?.open, url = isString(open) ? open : `http://localhost:${port}`;
|
|
1820
1823
|
open && openBrowser(url), setupCliShortcuts({
|
|
1821
1824
|
openPage: async ()=>{
|
|
@@ -1888,7 +1891,7 @@ function createUnpack({ cwd = process.cwd(), config, callerName = 'unpack' }) {
|
|
|
1888
1891
|
...mergeConfig(defaultConfig, config),
|
|
1889
1892
|
_context: {
|
|
1890
1893
|
callerName,
|
|
1891
|
-
version: "3.3.
|
|
1894
|
+
version: "3.3.7"
|
|
1892
1895
|
}
|
|
1893
1896
|
};
|
|
1894
1897
|
};
|
|
@@ -1896,7 +1899,7 @@ function createUnpack({ cwd = process.cwd(), config, callerName = 'unpack' }) {
|
|
|
1896
1899
|
build: async ({ watch } = {})=>{
|
|
1897
1900
|
setNodeEnv(watch ? 'development' : 'production');
|
|
1898
1901
|
let config = resolveConfig();
|
|
1899
|
-
console.log(colors.rainbow(`${callerName} v3.3.
|
|
1902
|
+
console.log(colors.rainbow(`${callerName} v3.3.7`), colors.green(`building for ${getNodeEnv()}...`)), await unpackBuild(config);
|
|
1900
1903
|
},
|
|
1901
1904
|
dev: async ()=>{
|
|
1902
1905
|
global.__unpack_start_time = performance.now(), setNodeEnv('development'), setDevServer(!0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAuBnE,wBAAsB,gBAAgB,CACpC,oBAAoB,EAAE,YAAY,GACjC,OAAO,CAAC,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAuBnE,wBAAsB,gBAAgB,CACpC,oBAAoB,EAAE,YAAY,GACjC,OAAO,CAAC,oBAAoB,CAAC,CA0M/B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/bundler-config/plugins/progress/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/bundler-config/plugins/progress/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AA8HvC,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,iBAsC/E"}
|