@unpackjs/core 2.3.1 → 2.3.2
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 +8 -8
- package/compiled/postcss-loader/index.js +10 -10
- package/compiled/sass-loader/index.js +8 -8
- package/compiled/webpack-bundle-analyzer/index.js +21 -13274
- package/dist/bundler-config/index.cjs +9 -12
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +7 -13
- package/dist/bundler-config/jsMinify.cjs +1 -1
- package/dist/bundler-config/jsMinify.js +1 -1
- package/dist/createUnpack.cjs +2 -2
- package/dist/createUnpack.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/logger.cjs +3 -5
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +3 -5
- package/dist/openBrowser.cjs +46 -61
- package/dist/openBrowser.d.ts.map +1 -1
- package/dist/openBrowser.js +2 -18
- package/dist/prebundleDeps.cjs +2 -2
- package/dist/prebundleDeps.js +2 -2
- package/dist/run/dev.cjs +1 -1
- package/dist/run/dev.js +1 -1
- package/dist/typed-css-modules/loader.cjs +115 -130
- package/dist/typed-css-modules/loader.d.ts.map +1 -1
- package/dist/typed-css-modules/loader.js +2 -18
- package/dist/types/config.d.ts +1 -1
- package/dist/utils.cjs +3 -5
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -5
- package/package.json +4 -12
- package/compiled/line-diff/index.d.ts +0 -1
- package/compiled/line-diff/index.js +0 -160
- package/compiled/line-diff/license +0 -21
- package/compiled/line-diff/package.json +0 -1
- package/compiled/portfinder/index.d.ts +0 -105
- package/compiled/portfinder/index.js +0 -3231
- package/compiled/portfinder/license +0 -22
- package/compiled/portfinder/package.json +0 -1
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
3
|
"../../compiled/webpack-bundle-analyzer/index.js": function(module) {
|
|
4
4
|
module.exports = require("../../compiled/webpack-bundle-analyzer/index.js");
|
|
5
|
-
},
|
|
6
|
-
"copy-webpack-plugin": function(module) {
|
|
7
|
-
module.exports = require("copy-webpack-plugin");
|
|
8
|
-
},
|
|
9
|
-
"ts-checker-rspack-plugin": function(module) {
|
|
10
|
-
module.exports = require("ts-checker-rspack-plugin");
|
|
11
5
|
}
|
|
12
6
|
};
|
|
13
7
|
var __webpack_module_cache__ = {};
|
|
@@ -61,15 +55,18 @@ var __webpack_exports__ = {};
|
|
|
61
55
|
const external_node_path_namespaceObject = require("node:path");
|
|
62
56
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
63
57
|
const core_namespaceObject = require("@rspack/core");
|
|
58
|
+
const external_copy_webpack_plugin_namespaceObject = require("copy-webpack-plugin");
|
|
59
|
+
var external_copy_webpack_plugin_default = /*#__PURE__*/ __webpack_require__.n(external_copy_webpack_plugin_namespaceObject);
|
|
64
60
|
const external_html_webpack_plugin_namespaceObject = require("html-webpack-plugin");
|
|
65
61
|
var external_html_webpack_plugin_default = /*#__PURE__*/ __webpack_require__.n(external_html_webpack_plugin_namespaceObject);
|
|
66
|
-
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
67
62
|
const external_json5_namespaceObject = require("json5");
|
|
68
63
|
var external_json5_default = /*#__PURE__*/ __webpack_require__.n(external_json5_namespaceObject);
|
|
69
64
|
const external_constants_cjs_namespaceObject = require("../constants.cjs");
|
|
70
65
|
const minimizer_cjs_namespaceObject = require("../lightningcss/minimizer.cjs");
|
|
71
66
|
const external_loadEnv_cjs_namespaceObject = require("../loadEnv.cjs");
|
|
72
67
|
const external_plugin_cjs_namespaceObject = require("../plugin.cjs");
|
|
68
|
+
const external_utils_cjs_namespaceObject = require("../utils.cjs");
|
|
69
|
+
const external_ts_checker_rspack_plugin_namespaceObject = require("ts-checker-rspack-plugin");
|
|
73
70
|
const external_webpack_namespaceObject = require("webpack");
|
|
74
71
|
var external_webpack_default = /*#__PURE__*/ __webpack_require__.n(external_webpack_namespaceObject);
|
|
75
72
|
const external_cache_cjs_namespaceObject = require("./cache.cjs");
|
|
@@ -81,9 +78,7 @@ var __webpack_exports__ = {};
|
|
|
81
78
|
const plugin_cjs_namespaceObject = require("./oxlint/plugin.cjs");
|
|
82
79
|
const rspack_cjs_namespaceObject = require("./progress/rspack.cjs");
|
|
83
80
|
const webpack_cjs_namespaceObject = require("./progress/webpack.cjs");
|
|
84
|
-
const { TsCheckerRspackPlugin } = __webpack_require__("ts-checker-rspack-plugin");
|
|
85
81
|
const BundleAnalyzerPlugin = __webpack_require__("../../compiled/webpack-bundle-analyzer/index.js").BundleAnalyzerPlugin;
|
|
86
|
-
const CopyWebpackPlugin = __webpack_require__("copy-webpack-plugin");
|
|
87
82
|
async function getBundlerConfig(unpackConfig) {
|
|
88
83
|
var _unpackConfig_build, _unpackConfig_build1, _unpackConfig_build2, _minifyOptions_oxc, _unpackConfig_build3, _unpackConfig_build4, _unpackConfig_build5, _unpackConfig_html, _unpackConfig_html1, _unpackConfig_html2, _unpackConfig_html3, _unpackConfig_html4, _unpackConfig_html5, _unpackConfig_html6, _unpackConfig_html7, _unpackConfig_html8, _unpackConfig_performance, _unpackConfig_performance1, _unpackConfig_build6, _unpackConfig_resolve, _unpackConfig_resolve1, _unpackConfig_dev, _unpackConfig_build7, _unpackConfig_experiments;
|
|
89
84
|
const isRspack = 'rspack' === unpackConfig.bundler;
|
|
@@ -94,7 +89,7 @@ var __webpack_exports__ = {};
|
|
|
94
89
|
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
95
90
|
});
|
|
96
91
|
const IgnorePlugin = isRspack ? core_namespaceObject.rspack.IgnorePlugin : external_webpack_default().IgnorePlugin;
|
|
97
|
-
const CopyPlugin = isRspack ? core_namespaceObject.rspack.CopyRspackPlugin :
|
|
92
|
+
const CopyPlugin = isRspack ? core_namespaceObject.rspack.CopyRspackPlugin : external_copy_webpack_plugin_default();
|
|
98
93
|
const tsconfigPath = external_node_path_default().resolve(unpackConfig.root, 'tsconfig.json');
|
|
99
94
|
const isTs = external_node_fs_default().existsSync(tsconfigPath);
|
|
100
95
|
const getAliasFromTsconfig = ()=>{
|
|
@@ -179,7 +174,9 @@ var __webpack_exports__ = {};
|
|
|
179
174
|
'main'
|
|
180
175
|
]
|
|
181
176
|
}),
|
|
182
|
-
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && (0, external_utils_cjs_namespaceObject.isProd)() && new BundleAnalyzerPlugin(
|
|
177
|
+
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && (0, external_utils_cjs_namespaceObject.isProd)() && new BundleAnalyzerPlugin({
|
|
178
|
+
analyzerPort: 'auto'
|
|
179
|
+
}),
|
|
183
180
|
(null == (_unpackConfig_performance1 = unpackConfig.performance) ? void 0 : _unpackConfig_performance1.removeMomentLocale) && new IgnorePlugin({
|
|
184
181
|
resourceRegExp: /^\.\/locale$/,
|
|
185
182
|
contextRegExp: /moment$/
|
|
@@ -187,7 +184,7 @@ var __webpack_exports__ = {};
|
|
|
187
184
|
(null == (_unpackConfig_build6 = unpackConfig.build) ? void 0 : _unpackConfig_build6.copy) && new CopyPlugin({
|
|
188
185
|
patterns: unpackConfig.build.copy
|
|
189
186
|
}),
|
|
190
|
-
unpackConfig.typeCheck && (0, external_utils_cjs_namespaceObject.isDev)() && isTs && new TsCheckerRspackPlugin({
|
|
187
|
+
unpackConfig.typeCheck && (0, external_utils_cjs_namespaceObject.isDev)() && isTs && new external_ts_checker_rspack_plugin_namespaceObject.TsCheckerRspackPlugin({
|
|
191
188
|
typescript: {
|
|
192
189
|
mode: 'readonly',
|
|
193
190
|
memoryLimit: 8192,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bundler-config/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAyBzE,wBAAsB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA4NhG"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import __rslib_shim_module__ from 'module';
|
|
2
2
|
const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE__compiled_webpack_bundle_analyzer_index_js_fd7b218e__ from "../../compiled/webpack-bundle-analyzer/index.js";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE_copy_webpack_plugin_34f78a42__ from "copy-webpack-plugin";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE_ts_checker_rspack_plugin_59177e58__ from "ts-checker-rspack-plugin";
|
|
6
4
|
import node_fs from "node:fs";
|
|
7
5
|
import node_path from "node:path";
|
|
8
6
|
import { rspack } from "@rspack/core";
|
|
7
|
+
import copy_webpack_plugin from "copy-webpack-plugin";
|
|
9
8
|
import html_webpack_plugin from "html-webpack-plugin";
|
|
10
|
-
import { getNodeEnv, isDev, isDevServer, isFunction, isPlainObject, isProd, mergeConfig } from "../utils.js";
|
|
11
9
|
import json5 from "json5";
|
|
12
10
|
import { DEFAULT_ES_TARGET, DEFAULT_LIGHTNINGCSS_TARGET, NODE_MODULES_REGEX, TEMPLATE_CONTENT } from "../constants.js";
|
|
13
11
|
import { LightningcssMinifyPlugin } from "../lightningcss/minimizer.js";
|
|
14
12
|
import { loadEnv } from "../loadEnv.js";
|
|
15
13
|
import { getNormalizedPluginsByHook } from "../plugin.js";
|
|
14
|
+
import { getNodeEnv, isDev, isDevServer, isFunction, isPlainObject, isProd, mergeConfig } from "../utils.js";
|
|
15
|
+
import { TsCheckerRspackPlugin } from "ts-checker-rspack-plugin";
|
|
16
16
|
import webpack from "webpack";
|
|
17
17
|
import { applyCacheConfig } from "./cache.js";
|
|
18
18
|
import { applyChunkSplitConfig } from "./chunkSplit.js";
|
|
@@ -26,12 +26,6 @@ import { ProgressWebpackPlugin } from "./progress/webpack.js";
|
|
|
26
26
|
var __webpack_modules__ = {
|
|
27
27
|
"../../compiled/webpack-bundle-analyzer/index.js": function(module) {
|
|
28
28
|
module.exports = __WEBPACK_EXTERNAL_MODULE__compiled_webpack_bundle_analyzer_index_js_fd7b218e__;
|
|
29
|
-
},
|
|
30
|
-
"copy-webpack-plugin": function(module) {
|
|
31
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_copy_webpack_plugin_34f78a42__;
|
|
32
|
-
},
|
|
33
|
-
"ts-checker-rspack-plugin": function(module) {
|
|
34
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_ts_checker_rspack_plugin_59177e58__;
|
|
35
29
|
}
|
|
36
30
|
};
|
|
37
31
|
var __webpack_module_cache__ = {};
|
|
@@ -44,9 +38,7 @@ function __webpack_require__(moduleId) {
|
|
|
44
38
|
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
45
39
|
return module.exports;
|
|
46
40
|
}
|
|
47
|
-
const { TsCheckerRspackPlugin } = __webpack_require__("ts-checker-rspack-plugin");
|
|
48
41
|
const BundleAnalyzerPlugin = __webpack_require__("../../compiled/webpack-bundle-analyzer/index.js").BundleAnalyzerPlugin;
|
|
49
|
-
const CopyWebpackPlugin = __webpack_require__("copy-webpack-plugin");
|
|
50
42
|
async function getBundlerConfig(unpackConfig) {
|
|
51
43
|
var _unpackConfig_build, _unpackConfig_build1, _unpackConfig_build2, _minifyOptions_oxc, _unpackConfig_build3, _unpackConfig_build4, _unpackConfig_build5, _unpackConfig_html, _unpackConfig_html1, _unpackConfig_html2, _unpackConfig_html3, _unpackConfig_html4, _unpackConfig_html5, _unpackConfig_html6, _unpackConfig_html7, _unpackConfig_html8, _unpackConfig_performance, _unpackConfig_performance1, _unpackConfig_build6, _unpackConfig_resolve, _unpackConfig_resolve1, _unpackConfig_dev, _unpackConfig_build7, _unpackConfig_experiments;
|
|
52
44
|
const isRspack = 'rspack' === unpackConfig.bundler;
|
|
@@ -57,7 +49,7 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
57
49
|
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
58
50
|
});
|
|
59
51
|
const IgnorePlugin = isRspack ? rspack.IgnorePlugin : webpack.IgnorePlugin;
|
|
60
|
-
const CopyPlugin = isRspack ? rspack.CopyRspackPlugin :
|
|
52
|
+
const CopyPlugin = isRspack ? rspack.CopyRspackPlugin : copy_webpack_plugin;
|
|
61
53
|
const tsconfigPath = node_path.resolve(unpackConfig.root, 'tsconfig.json');
|
|
62
54
|
const isTs = node_fs.existsSync(tsconfigPath);
|
|
63
55
|
const getAliasFromTsconfig = ()=>{
|
|
@@ -142,7 +134,9 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
142
134
|
'main'
|
|
143
135
|
]
|
|
144
136
|
}),
|
|
145
|
-
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && isProd() && new BundleAnalyzerPlugin(
|
|
137
|
+
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && isProd() && new BundleAnalyzerPlugin({
|
|
138
|
+
analyzerPort: 'auto'
|
|
139
|
+
}),
|
|
146
140
|
(null == (_unpackConfig_performance1 = unpackConfig.performance) ? void 0 : _unpackConfig_performance1.removeMomentLocale) && new IgnorePlugin({
|
|
147
141
|
resourceRegExp: /^\.\/locale$/,
|
|
148
142
|
contextRegExp: /moment$/
|
package/dist/createUnpack.cjs
CHANGED
|
@@ -67,7 +67,7 @@ function createUnpack({ cwd = process.cwd(), config, callerName = 'unpack' }) {
|
|
|
67
67
|
};
|
|
68
68
|
const _context = {
|
|
69
69
|
callerName,
|
|
70
|
-
version: "2.3.
|
|
70
|
+
version: "2.3.2"
|
|
71
71
|
};
|
|
72
72
|
let { plugins, bundlerConfig, ...rest } = (0, external_utils_cjs_namespaceObject.mergeConfig)(defaultConfig, config);
|
|
73
73
|
for (const plugin of (0, external_plugin_cjs_namespaceObject.getNormalizedPluginsByHook)('config', plugins))rest = await plugin.config(rest, {
|
|
@@ -84,7 +84,7 @@ function createUnpack({ cwd = process.cwd(), config, callerName = 'unpack' }) {
|
|
|
84
84
|
return {
|
|
85
85
|
build: async ({ watch } = {})=>{
|
|
86
86
|
(0, external_utils_cjs_namespaceObject.setNodeEnv)(watch ? 'development' : 'production');
|
|
87
|
-
console.log(external_colors_cjs_namespaceObject.colors.rainbow(`${callerName} v2.3.
|
|
87
|
+
console.log(external_colors_cjs_namespaceObject.colors.rainbow(`${callerName} v2.3.2`), external_colors_cjs_namespaceObject.colors.green(`building for ${watch ? 'development' : 'production'}...`));
|
|
88
88
|
const config = await resolveConfig();
|
|
89
89
|
(0, index_cjs_namespaceObject.unpackBuild)(config);
|
|
90
90
|
},
|
package/dist/createUnpack.js
CHANGED
|
@@ -41,7 +41,7 @@ function createUnpack({ cwd = process.cwd(), config, callerName = 'unpack' }) {
|
|
|
41
41
|
};
|
|
42
42
|
const _context = {
|
|
43
43
|
callerName,
|
|
44
|
-
version: "2.3.
|
|
44
|
+
version: "2.3.2"
|
|
45
45
|
};
|
|
46
46
|
let { plugins, bundlerConfig, ...rest } = mergeConfig(defaultConfig, config);
|
|
47
47
|
for (const plugin of getNormalizedPluginsByHook('config', plugins))rest = await plugin.config(rest, {
|
|
@@ -58,7 +58,7 @@ function createUnpack({ cwd = process.cwd(), config, callerName = 'unpack' }) {
|
|
|
58
58
|
return {
|
|
59
59
|
build: async ({ watch } = {})=>{
|
|
60
60
|
setNodeEnv(watch ? 'development' : 'production');
|
|
61
|
-
console.log(colors.rainbow(`${callerName} v2.3.
|
|
61
|
+
console.log(colors.rainbow(`${callerName} v2.3.2`), colors.green(`building for ${watch ? 'development' : 'production'}...`));
|
|
62
62
|
const config = await resolveConfig();
|
|
63
63
|
unpackBuild(config);
|
|
64
64
|
},
|
package/dist/index.cjs
CHANGED
|
@@ -21,7 +21,7 @@ var __webpack_modules__ = {
|
|
|
21
21
|
"./logger": function(module) {
|
|
22
22
|
module.exports = require("./logger.cjs");
|
|
23
23
|
},
|
|
24
|
-
"
|
|
24
|
+
"./types/index": function(module) {
|
|
25
25
|
module.exports = require("./types/index.cjs");
|
|
26
26
|
},
|
|
27
27
|
"./utils": function(module) {
|
|
@@ -170,7 +170,7 @@ var __webpack_exports__ = {};
|
|
|
170
170
|
return _logger__WEBPACK_IMPORTED_MODULE_9__[key];
|
|
171
171
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
172
172
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
173
|
-
var _types_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("
|
|
173
|
+
var _types_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__("./types/index");
|
|
174
174
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
175
175
|
for(var __WEBPACK_IMPORT_KEY__ in _types_index__WEBPACK_IMPORTED_MODULE_10__)if ([
|
|
176
176
|
"webpack",
|
package/dist/logger.cjs
CHANGED
|
@@ -47,7 +47,7 @@ const prefixes = {
|
|
|
47
47
|
info: "\u2139",
|
|
48
48
|
ready: "\u2713",
|
|
49
49
|
event: "\xbb",
|
|
50
|
-
debug:
|
|
50
|
+
debug: "\u279C"
|
|
51
51
|
};
|
|
52
52
|
const formatTime = ()=>{
|
|
53
53
|
const now = new Date();
|
|
@@ -82,10 +82,8 @@ const createLogger = ()=>{
|
|
|
82
82
|
text = message;
|
|
83
83
|
break;
|
|
84
84
|
}
|
|
85
|
-
if ('debug' === type)
|
|
86
|
-
|
|
87
|
-
console.log(text, ...args);
|
|
88
|
-
} else console.log(`${label} ${text}`, ...args);
|
|
85
|
+
if ('debug' === type && !(0, external_utils_cjs_namespaceObject.isDebug)()) return;
|
|
86
|
+
console.log(`${label} ${text}`, ...args);
|
|
89
87
|
};
|
|
90
88
|
const logger = {
|
|
91
89
|
clear: ()=>{
|
package/dist/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CAAA;AAsFrE,eAAO,MAAM,MAAM,QAAiB,CAAA"}
|
package/dist/logger.js
CHANGED
|
@@ -11,7 +11,7 @@ const prefixes = {
|
|
|
11
11
|
info: "\u2139",
|
|
12
12
|
ready: "\u2713",
|
|
13
13
|
event: "\xbb",
|
|
14
|
-
debug:
|
|
14
|
+
debug: "\u279C"
|
|
15
15
|
};
|
|
16
16
|
const formatTime = ()=>{
|
|
17
17
|
const now = new Date();
|
|
@@ -46,10 +46,8 @@ const createLogger = ()=>{
|
|
|
46
46
|
text = message;
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
|
-
if ('debug' === type)
|
|
50
|
-
|
|
51
|
-
console.log(text, ...args);
|
|
52
|
-
} else console.log(`${label} ${text}`, ...args);
|
|
49
|
+
if ('debug' === type && !isDebug()) return;
|
|
50
|
+
console.log(`${label} ${text}`, ...args);
|
|
53
51
|
};
|
|
54
52
|
const logger = {
|
|
55
53
|
clear: ()=>{
|
package/dist/openBrowser.cjs
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
open: function(module) {
|
|
4
|
-
module.exports = require("open");
|
|
5
|
-
}
|
|
6
|
-
};
|
|
7
|
-
var __webpack_module_cache__ = {};
|
|
8
|
-
function __webpack_require__(moduleId) {
|
|
9
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
-
exports: {}
|
|
13
|
-
};
|
|
14
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
-
return module.exports;
|
|
16
|
-
}
|
|
2
|
+
var __webpack_require__ = {};
|
|
17
3
|
(()=>{
|
|
18
4
|
__webpack_require__.n = (module)=>{
|
|
19
5
|
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
@@ -45,56 +31,55 @@ function __webpack_require__(moduleId) {
|
|
|
45
31
|
};
|
|
46
32
|
})();
|
|
47
33
|
var __webpack_exports__ = {};
|
|
48
|
-
(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return true;
|
|
77
|
-
}
|
|
78
|
-
} catch (err) {
|
|
79
|
-
external_logger_cjs_namespaceObject.logger.error(err);
|
|
80
|
-
}
|
|
81
|
-
try {
|
|
82
|
-
openBrowser_open(url).catch(()=>{});
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
openBrowser: ()=>openBrowser
|
|
37
|
+
});
|
|
38
|
+
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
39
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
40
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
41
|
+
const external_open_namespaceObject = require("open");
|
|
42
|
+
var external_open_default = /*#__PURE__*/ __webpack_require__.n(external_open_namespaceObject);
|
|
43
|
+
const external_logger_cjs_namespaceObject = require("./logger.cjs");
|
|
44
|
+
async function openBrowser(url) {
|
|
45
|
+
const supportedChromiumBrowsers = [
|
|
46
|
+
'Google Chrome Canary',
|
|
47
|
+
'Google Chrome Dev',
|
|
48
|
+
'Google Chrome Beta',
|
|
49
|
+
'Google Chrome',
|
|
50
|
+
'Microsoft Edge',
|
|
51
|
+
'Brave Browser',
|
|
52
|
+
'Vivaldi',
|
|
53
|
+
'Chromium'
|
|
54
|
+
];
|
|
55
|
+
if ('darwin' === process.platform) try {
|
|
56
|
+
const ps = await execAsync('ps cax');
|
|
57
|
+
const openedBrowser = supportedChromiumBrowsers.find((b)=>ps.includes(b));
|
|
58
|
+
if (openedBrowser) {
|
|
59
|
+
await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${openedBrowser}"`, {
|
|
60
|
+
cwd: external_node_path_default().join(__dirname, '../bin')
|
|
61
|
+
});
|
|
83
62
|
return true;
|
|
84
|
-
} catch (err) {
|
|
85
|
-
external_logger_cjs_namespaceObject.logger.error(err);
|
|
86
|
-
return false;
|
|
87
63
|
}
|
|
64
|
+
} catch (err) {
|
|
65
|
+
external_logger_cjs_namespaceObject.logger.error(err);
|
|
88
66
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
});
|
|
67
|
+
try {
|
|
68
|
+
external_open_default()(url).catch(()=>{});
|
|
69
|
+
return true;
|
|
70
|
+
} catch (err) {
|
|
71
|
+
external_logger_cjs_namespaceObject.logger.error(err);
|
|
72
|
+
return false;
|
|
96
73
|
}
|
|
97
|
-
}
|
|
74
|
+
}
|
|
75
|
+
function execAsync(command, options) {
|
|
76
|
+
return new Promise((resolve, reject)=>{
|
|
77
|
+
(0, external_node_child_process_namespaceObject.exec)(command, options, (error, stdout)=>{
|
|
78
|
+
if (error) reject(error);
|
|
79
|
+
else resolve(stdout.toString());
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
98
83
|
exports.openBrowser = __webpack_exports__.openBrowser;
|
|
99
84
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
100
85
|
"openBrowser"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openBrowser.d.ts","sourceRoot":"","sources":["../src/openBrowser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openBrowser.d.ts","sourceRoot":"","sources":["../src/openBrowser.ts"],"names":[],"mappings":"AAKA,wBAAsB,WAAW,CAAC,GAAG,EAAE,MAAM,oBAkC5C"}
|
package/dist/openBrowser.js
CHANGED
|
@@ -2,27 +2,11 @@ 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
|
-
import * as __WEBPACK_EXTERNAL_MODULE_open__ from "open";
|
|
6
5
|
import { exec } from "node:child_process";
|
|
7
6
|
import node_path from "node:path";
|
|
7
|
+
import open_0 from "open";
|
|
8
8
|
import { logger } from "./logger.js";
|
|
9
|
-
var __webpack_modules__ = {
|
|
10
|
-
open: function(module) {
|
|
11
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_open__;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
var __webpack_module_cache__ = {};
|
|
15
|
-
function __webpack_require__(moduleId) {
|
|
16
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
17
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
18
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
19
|
-
exports: {}
|
|
20
|
-
};
|
|
21
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
22
|
-
return module.exports;
|
|
23
|
-
}
|
|
24
9
|
var openBrowser_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
25
|
-
const openBrowser_open = __webpack_require__("open");
|
|
26
10
|
async function openBrowser(url) {
|
|
27
11
|
const supportedChromiumBrowsers = [
|
|
28
12
|
'Google Chrome Canary',
|
|
@@ -47,7 +31,7 @@ async function openBrowser(url) {
|
|
|
47
31
|
logger.error(err);
|
|
48
32
|
}
|
|
49
33
|
try {
|
|
50
|
-
|
|
34
|
+
open_0(url).catch(()=>{});
|
|
51
35
|
return true;
|
|
52
36
|
} catch (err) {
|
|
53
37
|
logger.error(err);
|
package/dist/prebundleDeps.cjs
CHANGED
|
@@ -247,7 +247,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
247
247
|
});
|
|
248
248
|
});
|
|
249
249
|
const userOptions = (0, external_utils_cjs_namespaceObject.isPlainObject)(null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.prebundle) ? unpackConfig.dev.prebundle : {};
|
|
250
|
-
const
|
|
250
|
+
const ignoreCSSDeps = userOptions.ignoreCSS || [];
|
|
251
251
|
const packageJson = JSON.parse(external_node_fs_default().readFileSync(external_node_path_default().resolve(root, 'package.json'), 'utf-8'));
|
|
252
252
|
const existExternals = getExistExternals(unpackConfig.externals);
|
|
253
253
|
const excludeDeps = [
|
|
@@ -306,7 +306,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
306
306
|
else jsAssets.push(serverPath);
|
|
307
307
|
break;
|
|
308
308
|
case '.css':
|
|
309
|
-
if (!
|
|
309
|
+
if (!ignoreCSSDeps.includes(dep.name)) cssAssets.push(serverPath);
|
|
310
310
|
break;
|
|
311
311
|
default:
|
|
312
312
|
break;
|
package/dist/prebundleDeps.js
CHANGED
|
@@ -207,7 +207,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
207
207
|
});
|
|
208
208
|
});
|
|
209
209
|
const userOptions = isPlainObject(null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.prebundle) ? unpackConfig.dev.prebundle : {};
|
|
210
|
-
const
|
|
210
|
+
const ignoreCSSDeps = userOptions.ignoreCSS || [];
|
|
211
211
|
const packageJson = JSON.parse(node_fs.readFileSync(node_path.resolve(root, 'package.json'), 'utf-8'));
|
|
212
212
|
const existExternals = getExistExternals(unpackConfig.externals);
|
|
213
213
|
const excludeDeps = [
|
|
@@ -266,7 +266,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
266
266
|
else jsAssets.push(serverPath);
|
|
267
267
|
break;
|
|
268
268
|
case '.css':
|
|
269
|
-
if (!
|
|
269
|
+
if (!ignoreCSSDeps.includes(dep.name)) cssAssets.push(serverPath);
|
|
270
270
|
break;
|
|
271
271
|
default:
|
|
272
272
|
break;
|
package/dist/run/dev.cjs
CHANGED
|
@@ -86,7 +86,7 @@ async function unpackDev(originalUnpackConfig) {
|
|
|
86
86
|
return middlewares;
|
|
87
87
|
};
|
|
88
88
|
const server = new (external_webpack_dev_server_default())(devServerOptions, compiler);
|
|
89
|
-
external_logger_cjs_namespaceObject.logger.greet(` ${external_colors_cjs_namespaceObject.colors.green(`${external_colors_cjs_namespaceObject.colors.bold(unpackConfig._context.callerName.toUpperCase())} v2.3.
|
|
89
|
+
external_logger_cjs_namespaceObject.logger.greet(` ${external_colors_cjs_namespaceObject.colors.green(`${external_colors_cjs_namespaceObject.colors.bold(unpackConfig._context.callerName.toUpperCase())} v2.3.2`)} ${external_colors_cjs_namespaceObject.colors.dim(`ready in ${external_colors_cjs_namespaceObject.colors.reset(Math.ceil(performance.now() - global.__unpack_start_time))}ms`)}\n`);
|
|
90
90
|
printAddressUrls(port);
|
|
91
91
|
await server.start();
|
|
92
92
|
external_global_cjs_namespaceObject.restartCleaners.push(async ()=>await server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())));
|
package/dist/run/dev.js
CHANGED
|
@@ -49,7 +49,7 @@ async function unpackDev(originalUnpackConfig) {
|
|
|
49
49
|
return middlewares;
|
|
50
50
|
};
|
|
51
51
|
const server = new webpack_dev_server(devServerOptions, compiler);
|
|
52
|
-
logger.greet(` ${colors.green(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v2.3.
|
|
52
|
+
logger.greet(` ${colors.green(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v2.3.2`)} ${colors.dim(`ready in ${colors.reset(Math.ceil(performance.now() - global.__unpack_start_time))}ms`)}\n`);
|
|
53
53
|
printAddressUrls(port);
|
|
54
54
|
await server.start();
|
|
55
55
|
restartCleaners.push(async ()=>await server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())));
|