@unpackjs/core 2.2.0 → 2.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.
- package/compiled/css-loader/index.js +49 -49
- package/compiled/less-loader/index.js +8 -8
- package/compiled/postcss-loader/index.js +39 -39
- package/compiled/sass-loader/index.js +8 -8
- package/dist/bundler-config/cache.cjs +16 -8
- package/dist/bundler-config/cache.d.ts +2 -1
- package/dist/bundler-config/cache.d.ts.map +1 -1
- package/dist/bundler-config/cache.js +23 -15
- package/dist/bundler-config/chunkSplit.d.ts.map +1 -1
- package/dist/bundler-config/chunkSplit.js +3 -3
- package/dist/bundler-config/css.cjs +13 -15
- package/dist/bundler-config/css.js +19 -21
- package/dist/bundler-config/experimentCss.cjs +12 -11
- package/dist/bundler-config/experimentCss.js +15 -14
- package/dist/bundler-config/helpers.d.ts.map +1 -1
- package/dist/bundler-config/helpers.js +6 -6
- package/dist/bundler-config/index.cjs +40 -13
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +56 -29
- package/dist/bundler-config/jsMinify.cjs +8 -10
- package/dist/bundler-config/jsMinify.d.ts +1 -1
- package/dist/bundler-config/jsMinify.d.ts.map +1 -1
- package/dist/bundler-config/jsMinify.js +11 -13
- package/dist/bundler-config/oxlint/.oxlintrc.json +0 -1
- package/dist/bundler-config/oxlint/plugin.cjs +1 -1
- package/dist/bundler-config/oxlint/plugin.js +5 -5
- package/dist/bundler-config/progress/helpers.cjs +16 -2
- package/dist/bundler-config/progress/helpers.d.ts.map +1 -1
- package/dist/bundler-config/progress/helpers.js +18 -4
- package/dist/bundler-config/progress/rspack.cjs +1 -1
- package/dist/bundler-config/progress/rspack.js +2 -2
- package/dist/bundler-config/progress/webpack.cjs +2 -2
- package/dist/bundler-config/progress/webpack.js +5 -5
- package/dist/colors.cjs +4 -4
- package/dist/colors.js +7 -7
- package/dist/config.cjs +6 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +10 -6
- package/dist/constants.cjs +16 -12
- package/dist/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -9
- package/dist/createUnpack.cjs +25 -23
- package/dist/createUnpack.d.ts +9 -4
- package/dist/createUnpack.d.ts.map +1 -1
- package/dist/createUnpack.js +27 -25
- package/dist/fs.cjs +10 -1
- package/dist/fs.d.ts +1 -0
- package/dist/fs.d.ts.map +1 -1
- package/dist/fs.js +13 -7
- package/dist/global.js +1 -1
- package/dist/index.cjs +64 -51
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -11
- package/dist/lightningcss/loader.js +1 -1
- package/dist/lightningcss/minimizer.cjs +7 -8
- package/dist/lightningcss/minimizer.d.ts +2 -2
- package/dist/lightningcss/minimizer.d.ts.map +1 -1
- package/dist/lightningcss/minimizer.js +8 -9
- package/dist/loadEnv.cjs +122 -0
- package/dist/loadEnv.d.ts +64 -0
- package/dist/loadEnv.d.ts.map +1 -0
- package/dist/loadEnv.js +80 -0
- package/dist/loadingAnimation.cjs +76 -0
- package/dist/loadingAnimation.d.ts +9 -0
- package/dist/loadingAnimation.d.ts.map +1 -0
- package/dist/loadingAnimation.js +44 -0
- package/dist/logger.cjs +15 -3
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +19 -7
- package/dist/openBrowser.d.ts.map +1 -1
- package/dist/openBrowser.js +3 -3
- package/dist/plugin.js +1 -1
- package/dist/prebundleDeps.cjs +27 -6
- package/dist/prebundleDeps.d.ts.map +1 -1
- package/dist/prebundleDeps.js +46 -25
- package/dist/progressBar.cjs +5 -2
- package/dist/progressBar.d.ts +2 -0
- package/dist/progressBar.d.ts.map +1 -1
- package/dist/progressBar.js +6 -3
- package/dist/reporter.cjs +4 -2
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +14 -12
- package/dist/run/build.cjs +4 -4
- package/dist/run/build.d.ts +1 -1
- package/dist/run/build.d.ts.map +1 -1
- package/dist/run/build.js +5 -5
- package/dist/run/dev.cjs +21 -13
- package/dist/run/dev.d.ts +1 -1
- package/dist/run/dev.d.ts.map +1 -1
- package/dist/run/dev.js +25 -17
- package/dist/run/index.js +1 -1
- package/dist/typed-css-modules/loader.cjs +2 -2
- package/dist/typed-css-modules/loader.d.ts.map +1 -1
- package/dist/typed-css-modules/loader.js +10 -10
- package/dist/typed-css-modules/plugin.js +5 -5
- package/dist/typed-css-modules/utils.d.ts.map +1 -1
- package/dist/typed-css-modules/utils.js +1 -1
- package/dist/types/chunkSplit.js +1 -1
- package/dist/types/config.d.ts +30 -6
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +1 -1
- package/dist/types/index.cjs +15 -15
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -3
- package/dist/types/lightningcss.d.ts +2 -2
- package/dist/types/lightningcss.d.ts.map +1 -1
- package/dist/types/lightningcss.js +1 -1
- package/dist/types/logger.js +1 -1
- package/dist/types/oxc.js +1 -1
- package/dist/types/plugin.d.ts +2 -2
- package/dist/types/plugin.d.ts.map +1 -1
- package/dist/types/plugin.js +1 -1
- package/dist/utils.cjs +3 -12
- package/dist/utils.d.ts +0 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +14 -20
- package/dist/watchFiles.cjs +1 -1
- package/dist/watchFiles.d.ts +1 -1
- package/dist/watchFiles.d.ts.map +1 -1
- package/dist/watchFiles.js +4 -4
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;IACvB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,OAAO,GAAG,aAAa,GAAG,YAAY,CAAA;AAElD,MAAM,MAAM,OAAO,GAAG,KAAK,GAAG,OAAO,CAAA;AAErC,MAAM,MAAM,eAAe,GACvB,YAAY,GACZ,gBAAgB,GAChB,aAAa,GACb,aAAa,GACb,cAAc,CAAA;AAElB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
export * from "./config.js";
|
|
4
3
|
export * from "./chunkSplit.js";
|
|
5
|
-
export * from "./
|
|
4
|
+
export * from "./config.js";
|
|
6
5
|
export * from "./lightningcss.js";
|
|
7
6
|
export * from "./logger.js";
|
|
7
|
+
export * from "./plugin.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type lightningcss from 'lightningcss';
|
|
2
2
|
import type { CustomAtRules, TransformOptions } from 'lightningcss';
|
|
3
3
|
export type Lightningcss = typeof lightningcss;
|
|
4
|
-
export type LightningcssTransformOptions = Omit<TransformOptions<CustomAtRules>, 'filename' | 'code' | 'inputSourceMap'>;
|
|
4
|
+
export type LightningcssTransformOptions = Omit<TransformOptions<CustomAtRules>, 'filename' | 'code' | 'inputSourceMap' | 'minify'>;
|
|
5
5
|
export type LightningcssLoaderOptions = LightningcssTransformOptions & {
|
|
6
6
|
implementation?: Lightningcss;
|
|
7
7
|
};
|
|
8
|
-
export type LightningcssMinifyPluginOptions =
|
|
8
|
+
export type LightningcssMinifyPluginOptions = LightningcssTransformOptions & {
|
|
9
9
|
implementation?: Lightningcss;
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=lightningcss.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lightningcss.d.ts","sourceRoot":"","sources":["../../src/types/lightningcss.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEnE,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAA;AAE9C,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,gBAAgB,CAAC,aAAa,CAAC,EAC/B,UAAU,GAAG,MAAM,GAAG,gBAAgB,
|
|
1
|
+
{"version":3,"file":"lightningcss.d.ts","sourceRoot":"","sources":["../../src/types/lightningcss.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,YAAY,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEnE,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAA;AAE9C,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,gBAAgB,CAAC,aAAa,CAAC,EAC/B,UAAU,GAAG,MAAM,GAAG,gBAAgB,GAAG,QAAQ,CAClD,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG,4BAA4B,GAAG;IACrE,cAAc,CAAC,EAAE,YAAY,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,+BAA+B,GAAG,4BAA4B,GAAG;IAC3E,cAAc,CAAC,EAAE,YAAY,CAAA;CAC9B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
package/dist/types/logger.js
CHANGED
package/dist/types/oxc.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
package/dist/types/plugin.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import type { BundlerConfiguration, UnpackConfig } from './config';
|
|
|
2
2
|
type PartialUnpackConfig = Omit<UnpackConfig, 'plugins' | 'bundlerConfig'>;
|
|
3
3
|
export type UnpackPlugin = {
|
|
4
4
|
name: string;
|
|
5
|
-
config?: (config: PartialUnpackConfig, context: {
|
|
5
|
+
config?: (config: PartialUnpackConfig, context: UnpackConfig['_context'] & {
|
|
6
6
|
mergeConfig: (...configs: PartialUnpackConfig[]) => PartialUnpackConfig;
|
|
7
7
|
}) => Promise<PartialUnpackConfig> | PartialUnpackConfig;
|
|
8
|
-
bundlerConfig?: (config: BundlerConfiguration, context: {
|
|
8
|
+
bundlerConfig?: (config: BundlerConfiguration, context: UnpackConfig['_context'] & {
|
|
9
9
|
unpackConfig: UnpackConfig;
|
|
10
10
|
mergeConfig: (...configs: BundlerConfiguration[]) => BundlerConfiguration;
|
|
11
11
|
}) => Promise<BundlerConfiguration> | BundlerConfiguration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAElE,KAAK,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,eAAe,CAAC,CAAA;AAC1E,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,CACP,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/types/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAElE,KAAK,mBAAmB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,eAAe,CAAC,CAAA;AAC1E,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,CACP,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,GAAG;QAClC,WAAW,EAAE,CAAC,GAAG,OAAO,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,CAAA;KACxE,KACE,OAAO,CAAC,mBAAmB,CAAC,GAAG,mBAAmB,CAAA;IACvD,aAAa,CAAC,EAAE,CACd,MAAM,EAAE,oBAAoB,EAC5B,OAAO,EAAE,YAAY,CAAC,UAAU,CAAC,GAAG;QAClC,YAAY,EAAE,YAAY,CAAA;QAC1B,WAAW,EAAE,CAAC,GAAG,OAAO,EAAE,oBAAoB,EAAE,KAAK,oBAAoB,CAAA;KAC1E,KACE,OAAO,CAAC,oBAAoB,CAAC,GAAG,oBAAoB,CAAA;CAC1D,CAAA;AACD,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA"}
|
package/dist/types/plugin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
package/dist/utils.cjs
CHANGED
|
@@ -54,7 +54,6 @@ var __webpack_exports__ = {};
|
|
|
54
54
|
isBoolean: ()=>isBoolean,
|
|
55
55
|
setDevServer: ()=>setDevServer,
|
|
56
56
|
setValueByPath: ()=>setValueByPath,
|
|
57
|
-
removeDir: ()=>removeDir,
|
|
58
57
|
getAddressUrls: ()=>getAddressUrls,
|
|
59
58
|
getUserDepVersion: ()=>getUserDepVersion,
|
|
60
59
|
isDevServer: ()=>utils_isDevServer,
|
|
@@ -85,7 +84,6 @@ var __webpack_exports__ = {};
|
|
|
85
84
|
getUserDepPath: ()=>getUserDepPath,
|
|
86
85
|
isProd: ()=>isProd
|
|
87
86
|
});
|
|
88
|
-
const external_colors_cjs_namespaceObject = require("./colors.cjs");
|
|
89
87
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
90
88
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
91
89
|
const external_node_net_namespaceObject = require("node:net");
|
|
@@ -94,10 +92,11 @@ var __webpack_exports__ = {};
|
|
|
94
92
|
var external_node_os_default = /*#__PURE__*/ __webpack_require__.n(external_node_os_namespaceObject);
|
|
95
93
|
const external_node_path_namespaceObject = require("node:path");
|
|
96
94
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
95
|
+
const external_colors_cjs_namespaceObject = require("./colors.cjs");
|
|
97
96
|
const external_constants_cjs_namespaceObject = require("./constants.cjs");
|
|
98
97
|
const external_logger_cjs_namespaceObject = require("./logger.cjs");
|
|
99
|
-
const portfinder = __webpack_require__("../compiled/portfinder/index.js");
|
|
100
98
|
const { merge } = __webpack_require__("../compiled/webpack-merge/index.js");
|
|
99
|
+
const portfinder = __webpack_require__("../compiled/portfinder/index.js");
|
|
101
100
|
const getNodeEnv = ()=>process.env.NODE_ENV;
|
|
102
101
|
const setNodeEnv = (env)=>{
|
|
103
102
|
process.env.NODE_ENV = env;
|
|
@@ -123,7 +122,7 @@ var __webpack_exports__ = {};
|
|
|
123
122
|
return Math.floor(num * factor) / factor;
|
|
124
123
|
};
|
|
125
124
|
if (seconds < 1) return `${toFixed(1000 * seconds, 0)}ms`;
|
|
126
|
-
if (seconds < 60) return `${toFixed(seconds,
|
|
125
|
+
if (seconds < 60) return `${toFixed(seconds, 2)}s`;
|
|
127
126
|
return `${toFixed(seconds / 60, 2)}m`;
|
|
128
127
|
};
|
|
129
128
|
const getValueByPath = (target, pathArray, defaultValue)=>{
|
|
@@ -265,12 +264,6 @@ var __webpack_exports__ = {};
|
|
|
265
264
|
clearLine();
|
|
266
265
|
process.stdout.write(output);
|
|
267
266
|
};
|
|
268
|
-
const removeDir = (dir)=>{
|
|
269
|
-
external_node_fs_default().rmSync(dir, {
|
|
270
|
-
recursive: true,
|
|
271
|
-
force: true
|
|
272
|
-
});
|
|
273
|
-
};
|
|
274
267
|
const isDebug = ()=>'unpack' === process.env.DEBUG;
|
|
275
268
|
})();
|
|
276
269
|
exports.clearLine = __webpack_exports__.clearLine;
|
|
@@ -301,7 +294,6 @@ exports.isWin = __webpack_exports__.isWin;
|
|
|
301
294
|
exports.logUpdate = __webpack_exports__.logUpdate;
|
|
302
295
|
exports.mergeConfig = __webpack_exports__.mergeConfig;
|
|
303
296
|
exports.prettyTime = __webpack_exports__.prettyTime;
|
|
304
|
-
exports.removeDir = __webpack_exports__.removeDir;
|
|
305
297
|
exports.setDevServer = __webpack_exports__.setDevServer;
|
|
306
298
|
exports.setNodeEnv = __webpack_exports__.setNodeEnv;
|
|
307
299
|
exports.setValueByPath = __webpack_exports__.setValueByPath;
|
|
@@ -335,7 +327,6 @@ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
|
335
327
|
"logUpdate",
|
|
336
328
|
"mergeConfig",
|
|
337
329
|
"prettyTime",
|
|
338
|
-
"removeDir",
|
|
339
330
|
"setDevServer",
|
|
340
331
|
"setNodeEnv",
|
|
341
332
|
"setValueByPath",
|
package/dist/utils.d.ts
CHANGED
|
@@ -43,7 +43,6 @@ export declare const mergeConfig: any;
|
|
|
43
43
|
export declare const getUserDepVersion: (root: string, dep: string) => any;
|
|
44
44
|
export declare const clearLine: () => void;
|
|
45
45
|
export declare const logUpdate: (output: string) => void;
|
|
46
|
-
export declare const removeDir: (dir: string) => void;
|
|
47
46
|
export declare const isDebug: () => boolean;
|
|
48
47
|
export {};
|
|
49
48
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"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"}
|
package/dist/utils.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
3
|
import { fileURLToPath as __webpack_fileURLToPath__ } from "node:url";
|
|
4
4
|
import { dirname as __webpack_dirname__ } from "node:path";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE__compiled_portfinder_index_js_249feeee__ from "../compiled/portfinder/index.js";
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE__compiled_webpack_merge_index_js_efd91626__ from "../compiled/webpack-merge/index.js";
|
|
7
|
+
import node_fs from "node:fs";
|
|
8
|
+
import node_net from "node:net";
|
|
9
|
+
import node_os from "node:os";
|
|
10
|
+
import node_path from "node:path";
|
|
7
11
|
import { colors } from "./colors.js";
|
|
8
|
-
import external_node_fs_default from "node:fs";
|
|
9
|
-
import external_node_net_default from "node:net";
|
|
10
|
-
import external_node_os_default from "node:os";
|
|
11
|
-
import external_node_path_default from "node:path";
|
|
12
12
|
import { DEFAULT_DEV_HOST } from "./constants.js";
|
|
13
13
|
import { logger } from "./logger.js";
|
|
14
14
|
var __webpack_modules__ = {
|
|
@@ -30,8 +30,8 @@ function __webpack_require__(moduleId) {
|
|
|
30
30
|
return module.exports;
|
|
31
31
|
}
|
|
32
32
|
var utils_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
33
|
-
const portfinder = __webpack_require__("../compiled/portfinder/index.js");
|
|
34
33
|
const { merge } = __webpack_require__("../compiled/webpack-merge/index.js");
|
|
34
|
+
const portfinder = __webpack_require__("../compiled/portfinder/index.js");
|
|
35
35
|
const getNodeEnv = ()=>process.env.NODE_ENV;
|
|
36
36
|
const setNodeEnv = (env)=>{
|
|
37
37
|
process.env.NODE_ENV = env;
|
|
@@ -57,7 +57,7 @@ const prettyTime = (seconds)=>{
|
|
|
57
57
|
return Math.floor(num * factor) / factor;
|
|
58
58
|
};
|
|
59
59
|
if (seconds < 1) return `${toFixed(1000 * seconds, 0)}ms`;
|
|
60
|
-
if (seconds < 60) return `${toFixed(seconds,
|
|
60
|
+
if (seconds < 60) return `${toFixed(seconds, 2)}s`;
|
|
61
61
|
return `${toFixed(seconds / 60, 2)}m`;
|
|
62
62
|
};
|
|
63
63
|
const getValueByPath = (target, pathArray, defaultValue)=>{
|
|
@@ -87,14 +87,14 @@ const getPort = (startPort = 45678)=>new Promise((resolve)=>{
|
|
|
87
87
|
resolve(port);
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
|
-
const getCompiledPkgPath = (packageName)=>
|
|
90
|
+
const getCompiledPkgPath = (packageName)=>node_path.join(utils_dirname, '../compiled', packageName);
|
|
91
91
|
const getUserDepPath = (root, deps)=>{
|
|
92
92
|
const dependencies = Array.isArray(deps) ? deps : [
|
|
93
93
|
deps
|
|
94
94
|
];
|
|
95
95
|
for (const dep of dependencies){
|
|
96
|
-
const absPath =
|
|
97
|
-
if (
|
|
96
|
+
const absPath = node_path.resolve(root, 'node_modules', dep);
|
|
97
|
+
if (node_fs.existsSync(absPath)) return absPath;
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
100
|
function getTime() {
|
|
@@ -114,7 +114,7 @@ const debounce = (fn, delay)=>{
|
|
|
114
114
|
};
|
|
115
115
|
};
|
|
116
116
|
const getIpv4Interfaces = ()=>{
|
|
117
|
-
const interfaces =
|
|
117
|
+
const interfaces = node_os.networkInterfaces();
|
|
118
118
|
const ipv4Interfaces = new Map();
|
|
119
119
|
for (const key of Object.keys(interfaces))for (const detail of interfaces[key]){
|
|
120
120
|
const familyV4Value = 'string' == typeof detail.family ? 'IPv4' : 4;
|
|
@@ -132,7 +132,7 @@ const isLoopbackHost = (host)=>{
|
|
|
132
132
|
return loopbackHosts.includes(host);
|
|
133
133
|
};
|
|
134
134
|
const getHostInUrl = (host)=>{
|
|
135
|
-
if (
|
|
135
|
+
if (node_net.isIPv6(host)) return '::' === host ? '[::1]' : `[${host}]`;
|
|
136
136
|
return host;
|
|
137
137
|
};
|
|
138
138
|
const concatUrl = ({ host, port, protocol })=>`${protocol}://${host}:${port}/`;
|
|
@@ -187,7 +187,7 @@ const mergeConfig = merge;
|
|
|
187
187
|
const getUserDepVersion = (root, dep)=>{
|
|
188
188
|
const depPath = getUserDepPath(root, dep);
|
|
189
189
|
if (!depPath) return;
|
|
190
|
-
const packageInfo = JSON.parse(
|
|
190
|
+
const packageInfo = JSON.parse(node_fs.readFileSync(node_path.resolve(depPath, 'package.json'), 'utf-8'));
|
|
191
191
|
return packageInfo.version;
|
|
192
192
|
};
|
|
193
193
|
const clearLine = ()=>{
|
|
@@ -199,11 +199,5 @@ const logUpdate = (output)=>{
|
|
|
199
199
|
clearLine();
|
|
200
200
|
process.stdout.write(output);
|
|
201
201
|
};
|
|
202
|
-
const removeDir = (dir)=>{
|
|
203
|
-
external_node_fs_default.rmSync(dir, {
|
|
204
|
-
recursive: true,
|
|
205
|
-
force: true
|
|
206
|
-
});
|
|
207
|
-
};
|
|
208
202
|
const isDebug = ()=>'unpack' === process.env.DEBUG;
|
|
209
|
-
export { clearLine, debounce, getAddressUrls, getCompiledPkgPath, getIpv4Interfaces, getNodeEnv, getPathInJs, getPort, getTime, getUserDepPath, getUserDepVersion, getValueByPath, isBoolean, isDebug, isDev, utils_isDevServer as isDevServer, isFunction, isObject, isPlainObject, isProd, isRegExp, isString, isUndefined, isWatch, isWin, logUpdate, mergeConfig, prettyTime,
|
|
203
|
+
export { clearLine, debounce, getAddressUrls, getCompiledPkgPath, getIpv4Interfaces, getNodeEnv, getPathInJs, getPort, getTime, getUserDepPath, getUserDepVersion, getValueByPath, isBoolean, isDebug, isDev, utils_isDevServer as isDevServer, isFunction, isObject, isPlainObject, isProd, isRegExp, isString, isUndefined, isWatch, isWin, logUpdate, mergeConfig, prettyTime, setDevServer, setNodeEnv, setValueByPath, trackPerformance };
|
package/dist/watchFiles.cjs
CHANGED
|
@@ -40,7 +40,7 @@ var external_chokidar_default = /*#__PURE__*/ __webpack_require__.n(external_cho
|
|
|
40
40
|
const external_tinyglobby_namespaceObject = require("tinyglobby");
|
|
41
41
|
const GLOB_REGEX = /[*?{}[\]()!@+|]/;
|
|
42
42
|
const isGlob = (str)=>GLOB_REGEX.test(str);
|
|
43
|
-
async function createChokidar(pathOrGlobs, root, options) {
|
|
43
|
+
async function createChokidar(pathOrGlobs, root = process.cwd(), options) {
|
|
44
44
|
const watchFiles = new Set();
|
|
45
45
|
const globPatterns = pathOrGlobs.filter((pathOrGlob)=>{
|
|
46
46
|
if (isGlob(pathOrGlob)) return true;
|
package/dist/watchFiles.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChokidarOptions, FSWatcher } from 'chokidar';
|
|
2
|
-
export declare function createChokidar(pathOrGlobs: string[], root
|
|
2
|
+
export declare function createChokidar(pathOrGlobs: string[], root?: string, options?: ChokidarOptions): Promise<FSWatcher>;
|
|
3
3
|
//# sourceMappingURL=watchFiles.d.ts.map
|
package/dist/watchFiles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchFiles.d.ts","sourceRoot":"","sources":["../src/watchFiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAW1D,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EAAE,EACrB,IAAI,
|
|
1
|
+
{"version":3,"file":"watchFiles.d.ts","sourceRoot":"","sources":["../src/watchFiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAW1D,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EAAE,EACrB,IAAI,GAAE,MAAsB,EAC5B,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,SAAS,CAAC,CAyBpB"}
|
package/dist/watchFiles.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import
|
|
3
|
+
import chokidar from "chokidar";
|
|
4
4
|
import { glob } from "tinyglobby";
|
|
5
5
|
const GLOB_REGEX = /[*?{}[\]()!@+|]/;
|
|
6
6
|
const isGlob = (str)=>GLOB_REGEX.test(str);
|
|
7
|
-
async function createChokidar(pathOrGlobs, root, options) {
|
|
7
|
+
async function createChokidar(pathOrGlobs, root = process.cwd(), options) {
|
|
8
8
|
const watchFiles = new Set();
|
|
9
9
|
const globPatterns = pathOrGlobs.filter((pathOrGlob)=>{
|
|
10
10
|
if (isGlob(pathOrGlob)) return true;
|
|
@@ -18,7 +18,7 @@ async function createChokidar(pathOrGlobs, root, options) {
|
|
|
18
18
|
});
|
|
19
19
|
for (const file of files)watchFiles.add(file);
|
|
20
20
|
}
|
|
21
|
-
return
|
|
21
|
+
return chokidar.watch(Array.from(watchFiles), {
|
|
22
22
|
ignoreInitial: true,
|
|
23
23
|
ignorePermissionErrors: true,
|
|
24
24
|
...options
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unpackjs/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -77,11 +77,12 @@
|
|
|
77
77
|
"webpack-merge": "6.0.1"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@rspack/core": "1.
|
|
80
|
+
"@rspack/core": "1.4.1",
|
|
81
81
|
"@types/less": "3.0.8",
|
|
82
82
|
"chokidar": "4.0.3",
|
|
83
83
|
"copy-webpack-plugin": "13.0.0",
|
|
84
84
|
"cors": "2.8.5",
|
|
85
|
+
"dotenv-expand": "12.0.2",
|
|
85
86
|
"express": "5.1.0",
|
|
86
87
|
"html-webpack-plugin": "5.6.3",
|
|
87
88
|
"jiti": "2.4.2",
|
|
@@ -89,9 +90,9 @@
|
|
|
89
90
|
"lightningcss": "1.30.1",
|
|
90
91
|
"mini-css-extract-plugin": "2.9.2",
|
|
91
92
|
"open": "8.4.2",
|
|
92
|
-
"oxc-minify": "0.
|
|
93
|
+
"oxc-minify": "0.75.0",
|
|
93
94
|
"picocolors": "1.1.1",
|
|
94
|
-
"postcss": "8.5.
|
|
95
|
+
"postcss": "8.5.6",
|
|
95
96
|
"thread-loader": "4.0.4",
|
|
96
97
|
"tinyglobby": "0.2.14",
|
|
97
98
|
"ts-checker-rspack-plugin": "1.1.4",
|