@unpackjs/core 1.7.10 → 1.7.12
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/portfinder/index.d.ts +21 -1
- package/compiled/portfinder/index.js +33 -14
- package/compiled/portfinder/package.json +1 -1
- package/compiled/postcss-loader/index.js +8 -8
- package/compiled/sass-loader/index.js +8 -8
- package/compiled/style-loader/index.js +10 -10
- package/dist/bundler-config/css.cjs +16 -16
- package/dist/bundler-config/css.js +19 -19
- package/dist/bundler-config/experimentCss.cjs +15 -15
- package/dist/bundler-config/experimentCss.js +17 -17
- package/dist/bundler-config/index.cjs +35 -23
- package/dist/bundler-config/index.d.ts.map +1 -1
- package/dist/bundler-config/index.js +35 -23
- package/dist/bundler-config/jsMinify.cjs +1 -1
- package/dist/bundler-config/jsMinify.js +1 -1
- package/dist/colors.cjs +2 -2
- package/dist/colors.js +2 -2
- package/dist/config.js +2 -2
- package/dist/createUnpack.cjs +2 -2
- package/dist/createUnpack.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.js +7 -39
- package/dist/lightningcss/loader.cjs +2 -2
- package/dist/lightningcss/loader.js +2 -2
- package/dist/lightningcss/minimizer.cjs +3 -3
- package/dist/lightningcss/minimizer.js +3 -3
- package/dist/logger.cjs +2 -2
- package/dist/logger.js +2 -2
- package/dist/openBrowser.cjs +2 -2
- package/dist/openBrowser.js +4 -4
- package/dist/prebundleDeps.cjs +3 -9
- package/dist/prebundleDeps.js +3 -9
- package/dist/run/dev.cjs +5 -5
- package/dist/run/dev.js +5 -5
- package/dist/typed-css-modules/loader.cjs +4 -10
- package/dist/typed-css-modules/loader.js +4 -10
- package/dist/typed-css-modules/plugin.cjs +1 -1
- package/dist/typed-css-modules/plugin.js +1 -1
- package/dist/types/logger.js +2 -2
- package/dist/utils.cjs +3 -3
- package/dist/utils.js +5 -5
- package/package.json +5 -5
|
@@ -51,7 +51,7 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
51
51
|
const definePlugin = (define)=>isRspack ? new __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack.DefinePlugin(define) : new __WEBPACK_EXTERNAL_MODULE_webpack__["default"].DefinePlugin(define);
|
|
52
52
|
const JS_FILENAME = (0, __WEBPACK_EXTERNAL_MODULE__helper_js_3f3fef5c__.getOutputFilename)({
|
|
53
53
|
type: 'js',
|
|
54
|
-
hash: null
|
|
54
|
+
hash: null == (_unpackConfig_build = unpackConfig.build) ? void 0 : _unpackConfig_build.filenameHash
|
|
55
55
|
});
|
|
56
56
|
const IgnorePlugin = isRspack ? __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack.IgnorePlugin : __WEBPACK_EXTERNAL_MODULE_webpack__["default"].IgnorePlugin;
|
|
57
57
|
const CopyPlugin = isRspack ? __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack.CopyRspackPlugin : CopyWebpackPlugin;
|
|
@@ -59,14 +59,15 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
59
59
|
const isTs = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(tsconfigPath);
|
|
60
60
|
const getAliasFromTsconfig = ()=>{
|
|
61
61
|
var _json5_parse_compilerOptions, _json5_parse;
|
|
62
|
-
const paths = null
|
|
62
|
+
const paths = null == (_json5_parse = __WEBPACK_EXTERNAL_MODULE_json5__["default"].parse(__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].readFileSync(tsconfigPath, 'utf-8'))) ? void 0 : null == (_json5_parse_compilerOptions = _json5_parse.compilerOptions) ? void 0 : _json5_parse_compilerOptions.paths;
|
|
63
63
|
return paths ? Object.keys(paths).reduce((acc, key)=>{
|
|
64
64
|
acc[key.replace(/\/\*$/, '')] = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(unpackConfig.root, paths[key][0].replace(/\/\*$/, ''));
|
|
65
65
|
return acc;
|
|
66
66
|
}, {}) : {};
|
|
67
67
|
};
|
|
68
|
-
const minifyOptions = (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isPlainObject)(null
|
|
68
|
+
const minifyOptions = (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isPlainObject)(null == (_unpackConfig_build1 = unpackConfig.build) ? void 0 : _unpackConfig_build1.minify) ? null == (_unpackConfig_build2 = unpackConfig.build) ? void 0 : _unpackConfig_build2.minify : {};
|
|
69
69
|
const PluginProgress = isRspack ? __WEBPACK_EXTERNAL_MODULE__plugin_progress_rspack_js_7c160de9__.RspackPluginProgress : __WEBPACK_EXTERNAL_MODULE__plugin_progress_webpack_js_077e3654__.WebpackPluginProgress;
|
|
70
|
+
const wasmFilename = 'js/[hash].module.wasm';
|
|
70
71
|
let config = {
|
|
71
72
|
context: unpackConfig.root,
|
|
72
73
|
mode: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isDev)() ? 'development' : 'production',
|
|
@@ -76,17 +77,18 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
76
77
|
stats: 'errors-only',
|
|
77
78
|
output: {
|
|
78
79
|
clean: true,
|
|
79
|
-
path: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(unpackConfig.root, null
|
|
80
|
+
path: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(unpackConfig.root, null == (_unpackConfig_build3 = unpackConfig.build) ? void 0 : _unpackConfig_build3.outDir),
|
|
80
81
|
filename: JS_FILENAME,
|
|
81
82
|
chunkFilename: JS_FILENAME,
|
|
82
83
|
crossOriginLoading: 'anonymous',
|
|
83
84
|
pathinfo: false,
|
|
84
|
-
publicPath: null
|
|
85
|
+
publicPath: null == (_unpackConfig_build4 = unpackConfig.build) ? void 0 : _unpackConfig_build4.publicPath,
|
|
86
|
+
webassemblyModuleFilename: wasmFilename
|
|
85
87
|
},
|
|
86
88
|
infrastructureLogging: {
|
|
87
89
|
level: 'warn'
|
|
88
90
|
},
|
|
89
|
-
devtool: null
|
|
91
|
+
devtool: null == (_unpackConfig_build5 = unpackConfig.build) ? void 0 : _unpackConfig_build5.sourceMap,
|
|
90
92
|
module: {
|
|
91
93
|
rules: [
|
|
92
94
|
{
|
|
@@ -96,36 +98,44 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
96
98
|
{
|
|
97
99
|
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
98
100
|
type: 'asset/resource'
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
test: /\.wasm$/,
|
|
104
|
+
dependency: 'url',
|
|
105
|
+
type: 'asset/resource',
|
|
106
|
+
generator: {
|
|
107
|
+
filename: wasmFilename
|
|
108
|
+
}
|
|
99
109
|
}
|
|
100
110
|
]
|
|
101
111
|
},
|
|
102
112
|
plugins: [
|
|
103
113
|
unpackConfig.define && definePlugin(unpackConfig.define),
|
|
104
114
|
!unpackConfig.mpa && new HtmlPlugin({
|
|
105
|
-
template: (null
|
|
106
|
-
templateContent: (null
|
|
115
|
+
template: (null == (_unpackConfig_html = unpackConfig.html) ? void 0 : _unpackConfig_html.template) || (isRspack ? void 0 : ''),
|
|
116
|
+
templateContent: (null == (_unpackConfig_html1 = unpackConfig.html) ? void 0 : _unpackConfig_html1.templateContent) || ((null == (_unpackConfig_html2 = unpackConfig.html) ? void 0 : _unpackConfig_html2.template) ? isRspack ? void 0 : false : __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.TEMPLATE_CONTENT),
|
|
107
117
|
templateParameters: {
|
|
108
|
-
mountId: null
|
|
109
|
-
title: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isFunction)(null
|
|
118
|
+
mountId: null == (_unpackConfig_html3 = unpackConfig.html) ? void 0 : _unpackConfig_html3.mountId,
|
|
119
|
+
title: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isFunction)(null == (_unpackConfig_html4 = unpackConfig.html) ? void 0 : _unpackConfig_html4.title) ? null == (_unpackConfig_html5 = unpackConfig.html) ? void 0 : _unpackConfig_html5.title({
|
|
110
120
|
entryName: 'index'
|
|
111
|
-
}) : (null
|
|
112
|
-
headTag: (null
|
|
113
|
-
...null
|
|
121
|
+
}) : (null == (_unpackConfig_html6 = unpackConfig.html) ? void 0 : _unpackConfig_html6.title) || '',
|
|
122
|
+
headTag: (null == (_unpackConfig_html7 = unpackConfig.html) ? void 0 : _unpackConfig_html7.headTag) || '',
|
|
123
|
+
...null == (_unpackConfig_html8 = unpackConfig.html) ? void 0 : _unpackConfig_html8.templateParameters
|
|
114
124
|
},
|
|
115
125
|
minify: false,
|
|
116
126
|
chunks: [
|
|
117
127
|
'main'
|
|
118
128
|
]
|
|
119
129
|
}),
|
|
120
|
-
(null
|
|
121
|
-
(null
|
|
130
|
+
(null == (_unpackConfig_performance = unpackConfig.performance) ? void 0 : _unpackConfig_performance.bundleAnalyze) && (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isProd)() && new BundleAnalyzerPlugin(),
|
|
131
|
+
(null == (_unpackConfig_performance1 = unpackConfig.performance) ? void 0 : _unpackConfig_performance1.removeMomentLocale) && new IgnorePlugin({
|
|
122
132
|
resourceRegExp: /^\.\/locale$/,
|
|
123
133
|
contextRegExp: /moment$/
|
|
124
134
|
}),
|
|
125
|
-
(null
|
|
135
|
+
(null == (_unpackConfig_build6 = unpackConfig.build) ? void 0 : _unpackConfig_build6.copy) && new CopyPlugin({
|
|
126
136
|
patterns: unpackConfig.build.copy
|
|
127
137
|
}),
|
|
128
|
-
(null
|
|
138
|
+
(null == (_unpackConfig_build7 = unpackConfig.build) ? void 0 : _unpackConfig_build7.typeCheck) && (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isDev)() && isTs && new TsCheckerRspackPlugin({
|
|
129
139
|
typescript: {
|
|
130
140
|
mode: 'readonly',
|
|
131
141
|
memoryLimit: 8192,
|
|
@@ -157,26 +167,28 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
157
167
|
alias: {
|
|
158
168
|
'@': __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(unpackConfig.root, 'src'),
|
|
159
169
|
...isTs ? getAliasFromTsconfig() : {},
|
|
160
|
-
...null
|
|
170
|
+
...null == (_unpackConfig_resolve = unpackConfig.resolve) ? void 0 : _unpackConfig_resolve.alias
|
|
161
171
|
},
|
|
162
172
|
extensions: [
|
|
163
173
|
'.tsx',
|
|
164
174
|
'.ts',
|
|
165
175
|
'.jsx',
|
|
166
176
|
'.js',
|
|
167
|
-
|
|
177
|
+
'.wasm',
|
|
178
|
+
...(null == (_unpackConfig_resolve1 = unpackConfig.resolve) ? void 0 : _unpackConfig_resolve1.extensions) || []
|
|
168
179
|
]
|
|
169
180
|
},
|
|
170
181
|
experiments: {
|
|
171
|
-
lazyCompilation: (null
|
|
182
|
+
lazyCompilation: (null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.lazyCompilation) && (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isDevServer)(),
|
|
172
183
|
css: false,
|
|
184
|
+
asyncWebAssembly: true,
|
|
173
185
|
...isRspack && (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isDev)() ? {
|
|
174
186
|
incremental: true
|
|
175
187
|
} : {}
|
|
176
188
|
},
|
|
177
189
|
optimization: {
|
|
178
190
|
moduleIds: (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.isDev)() ? 'named' : 'deterministic',
|
|
179
|
-
minimize: Boolean(null
|
|
191
|
+
minimize: Boolean(null == (_unpackConfig_build8 = unpackConfig.build) ? void 0 : _unpackConfig_build8.minify),
|
|
180
192
|
minimizer: [
|
|
181
193
|
new __WEBPACK_EXTERNAL_MODULE__jsMinify_js_f62b6778__.JsMinifyPlugin({
|
|
182
194
|
target: __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.ESBUILD_TARGET
|
|
@@ -184,14 +196,14 @@ async function getBundlerConfig(unpackConfig) {
|
|
|
184
196
|
new __WEBPACK_EXTERNAL_MODULE__lightningcss_minimizer_js_13e64036__.LightningcssMinifyPlugin(minifyOptions.lightningcss)
|
|
185
197
|
]
|
|
186
198
|
},
|
|
187
|
-
cache: (null
|
|
199
|
+
cache: (null == (_unpackConfig_build9 = unpackConfig.build) ? void 0 : _unpackConfig_build9.cache) && 'webpack' === unpackConfig.bundler ? {
|
|
188
200
|
type: 'filesystem'
|
|
189
201
|
} : void 0,
|
|
190
202
|
watchOptions: {
|
|
191
203
|
ignored: /[\\/](?:\.git|node_modules)[\\/]/
|
|
192
204
|
}
|
|
193
205
|
};
|
|
194
|
-
config = (null
|
|
206
|
+
config = (null == (_unpackConfig_experiments = unpackConfig.experiments) ? void 0 : _unpackConfig_experiments.css) ? (0, __WEBPACK_EXTERNAL_MODULE__experimentCss_js_9e7bd201__.applyExperimentCssConfig)({
|
|
195
207
|
config,
|
|
196
208
|
unpackConfig
|
|
197
209
|
}) : (0, __WEBPACK_EXTERNAL_MODULE__css_js_1fdaa05b__.applyCssConfig)({
|
|
@@ -56,7 +56,7 @@ class JsMinifyPlugin {
|
|
|
56
56
|
const { implementation, ...transformOptions } = this.options;
|
|
57
57
|
const meta = JSON.stringify({
|
|
58
58
|
name: PLUGIN_NAME,
|
|
59
|
-
version: "1.7.
|
|
59
|
+
version: "1.7.12",
|
|
60
60
|
options: transformOptions
|
|
61
61
|
});
|
|
62
62
|
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation)=>{
|
|
@@ -20,7 +20,7 @@ class JsMinifyPlugin {
|
|
|
20
20
|
const { implementation, ...transformOptions } = this.options;
|
|
21
21
|
const meta = JSON.stringify({
|
|
22
22
|
name: PLUGIN_NAME,
|
|
23
|
-
version: "1.7.
|
|
23
|
+
version: "1.7.12",
|
|
24
24
|
options: transformOptions
|
|
25
25
|
});
|
|
26
26
|
compiler.hooks.compilation.tap(PLUGIN_NAME, (compilation)=>{
|
package/dist/colors.cjs
CHANGED
|
@@ -33,7 +33,7 @@ var __webpack_require__ = {};
|
|
|
33
33
|
var __webpack_exports__ = {};
|
|
34
34
|
__webpack_require__.r(__webpack_exports__);
|
|
35
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
default: ()=>
|
|
36
|
+
default: ()=>src_colors
|
|
37
37
|
});
|
|
38
38
|
const external_picocolors_namespaceObject = require("picocolors");
|
|
39
39
|
var external_picocolors_default = /*#__PURE__*/ __webpack_require__.n(external_picocolors_namespaceObject);
|
|
@@ -73,7 +73,7 @@ const colors = {
|
|
|
73
73
|
return output;
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
const
|
|
76
|
+
const src_colors = colors;
|
|
77
77
|
exports["default"] = __webpack_exports__["default"];
|
|
78
78
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
79
79
|
"default"
|
package/dist/colors.js
CHANGED
package/dist/config.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_jiti__ from "jiti";
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE__logger_js_c2be5186__ from "./logger.js";
|
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__ from "./utils.js";
|
|
9
|
-
var
|
|
9
|
+
var config_filename = __webpack_fileURLToPath__(import.meta.url);
|
|
10
10
|
async function loadConfig({ cliOptions, command }) {
|
|
11
11
|
if ('build' === command) (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.setNodeEnv)((null == cliOptions ? void 0 : cliOptions.watch) ? 'development' : 'production');
|
|
12
12
|
else {
|
|
@@ -16,7 +16,7 @@ async function loadConfig({ cliOptions, command }) {
|
|
|
16
16
|
const configPath = resolveConfigPath(process.cwd(), null == cliOptions ? void 0 : cliOptions.config);
|
|
17
17
|
let userConfig = {};
|
|
18
18
|
if (configPath) {
|
|
19
|
-
const jiti = (0, __WEBPACK_EXTERNAL_MODULE_jiti__.createJiti)(
|
|
19
|
+
const jiti = (0, __WEBPACK_EXTERNAL_MODULE_jiti__.createJiti)(config_filename, {
|
|
20
20
|
moduleCache: false,
|
|
21
21
|
interopDefault: true,
|
|
22
22
|
nativeModules: [
|
package/dist/createUnpack.cjs
CHANGED
|
@@ -86,7 +86,7 @@ function createUnpack() {
|
|
|
86
86
|
return {
|
|
87
87
|
build: async (unpackConfig)=>{
|
|
88
88
|
(0, external_utils_cjs_namespaceObject.setNodeEnv)('production');
|
|
89
|
-
console.log(external_colors_cjs_default().rainbow("unpack v1.7.
|
|
89
|
+
console.log(external_colors_cjs_default().rainbow("unpack v1.7.12"), external_colors_cjs_default().green('building for production...'));
|
|
90
90
|
const config = await resolveConfig(unpackConfig);
|
|
91
91
|
(0, index_cjs_namespaceObject.bundlerBuild)(config);
|
|
92
92
|
},
|
|
@@ -99,7 +99,7 @@ function createUnpack() {
|
|
|
99
99
|
},
|
|
100
100
|
watch: async (unpackConfig)=>{
|
|
101
101
|
(0, external_utils_cjs_namespaceObject.setNodeEnv)('development');
|
|
102
|
-
console.log(external_colors_cjs_default().rainbow("unpack v1.7.
|
|
102
|
+
console.log(external_colors_cjs_default().rainbow("unpack v1.7.12"), external_colors_cjs_default().green('building for development...'));
|
|
103
103
|
const config = await resolveConfig(unpackConfig);
|
|
104
104
|
(0, index_cjs_namespaceObject.bundlerBuild)(config);
|
|
105
105
|
}
|
package/dist/createUnpack.js
CHANGED
|
@@ -50,7 +50,7 @@ function createUnpack() {
|
|
|
50
50
|
return {
|
|
51
51
|
build: async (unpackConfig)=>{
|
|
52
52
|
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.setNodeEnv)('production');
|
|
53
|
-
console.log(__WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].rainbow("unpack v1.7.
|
|
53
|
+
console.log(__WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].rainbow("unpack v1.7.12"), __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].green('building for production...'));
|
|
54
54
|
const config = await resolveConfig(unpackConfig);
|
|
55
55
|
(0, __WEBPACK_EXTERNAL_MODULE__run_index_js_f05de1fb__.bundlerBuild)(config);
|
|
56
56
|
},
|
|
@@ -63,7 +63,7 @@ function createUnpack() {
|
|
|
63
63
|
},
|
|
64
64
|
watch: async (unpackConfig)=>{
|
|
65
65
|
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.setNodeEnv)('development');
|
|
66
|
-
console.log(__WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].rainbow("unpack v1.7.
|
|
66
|
+
console.log(__WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].rainbow("unpack v1.7.12"), __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"].green('building for development...'));
|
|
67
67
|
const config = await resolveConfig(unpackConfig);
|
|
68
68
|
(0, __WEBPACK_EXTERNAL_MODULE__run_index_js_f05de1fb__.bundlerBuild)(config);
|
|
69
69
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
"
|
|
3
|
+
"./colors": function(module) {
|
|
4
4
|
module.exports = require("./colors.cjs");
|
|
5
5
|
},
|
|
6
6
|
"./config": function(module) {
|
|
@@ -18,7 +18,7 @@ var __webpack_modules__ = {
|
|
|
18
18
|
"./logger": function(module) {
|
|
19
19
|
module.exports = require("./logger.cjs");
|
|
20
20
|
},
|
|
21
|
-
"
|
|
21
|
+
"./types/index": function(module) {
|
|
22
22
|
module.exports = require("./types/index.cjs");
|
|
23
23
|
},
|
|
24
24
|
"./utils": function(module) {
|
|
@@ -101,7 +101,7 @@ var __webpack_exports__ = {};
|
|
|
101
101
|
return _logger__WEBPACK_IMPORTED_MODULE_2__[key];
|
|
102
102
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
103
103
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
104
|
-
var _types_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("
|
|
104
|
+
var _types_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./types/index");
|
|
105
105
|
var __WEBPACK_REEXPORT_OBJECT__ = {};
|
|
106
106
|
for(var __WEBPACK_IMPORT_KEY__ in _types_index__WEBPACK_IMPORTED_MODULE_3__)if ([
|
|
107
107
|
"default",
|
|
@@ -161,7 +161,7 @@ var __webpack_exports__ = {};
|
|
|
161
161
|
return _config__WEBPACK_IMPORTED_MODULE_7__[key];
|
|
162
162
|
}).bind(0, __WEBPACK_IMPORT_KEY__);
|
|
163
163
|
__webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
|
|
164
|
-
var _colors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("
|
|
164
|
+
var _colors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__("./colors");
|
|
165
165
|
var _colors__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/ __webpack_require__.n(_colors__WEBPACK_IMPORTED_MODULE_8__);
|
|
166
166
|
var html_webpack_plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__("html-webpack-plugin");
|
|
167
167
|
var html_webpack_plugin__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/ __webpack_require__.n(html_webpack_plugin__WEBPACK_IMPORTED_MODULE_9__);
|
package/dist/index.js
CHANGED
|
@@ -1,51 +1,19 @@
|
|
|
1
1
|
import __rslib_shim_module__ from 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
import * as __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__ from "./colors.js";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE__types_index_js_63ede62f__ from "./types/index.js";
|
|
5
3
|
import * as __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__ from "@rspack/core";
|
|
6
|
-
import * as __WEBPACK_EXTERNAL_MODULE_html_webpack_plugin_e07f62c9__ from "html-webpack-plugin";
|
|
7
4
|
import * as __WEBPACK_EXTERNAL_MODULE_webpack__ from "webpack";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__ from "./colors.js";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_html_webpack_plugin_e07f62c9__ from "html-webpack-plugin";
|
|
8
7
|
export * from "./logger.js";
|
|
8
|
+
export * from "./types/index.js";
|
|
9
9
|
export * from "./utils.js";
|
|
10
10
|
export * from "./constants.js";
|
|
11
11
|
export * from "./createUnpack.js";
|
|
12
12
|
export * from "./config.js";
|
|
13
13
|
export * from "./watchFiles.js";
|
|
14
14
|
export * from "./global.js";
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"src/types/index": function(module) {
|
|
20
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__types_index_js_63ede62f__;
|
|
21
|
-
},
|
|
22
|
-
"@rspack/core": function(module) {
|
|
23
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__;
|
|
24
|
-
},
|
|
25
|
-
"html-webpack-plugin": function(module) {
|
|
26
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_html_webpack_plugin_e07f62c9__;
|
|
27
|
-
},
|
|
28
|
-
webpack: function(module) {
|
|
29
|
-
module.exports = __WEBPACK_EXTERNAL_MODULE_webpack__;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
var __webpack_module_cache__ = {};
|
|
33
|
-
function __webpack_require__(moduleId) {
|
|
34
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
|
35
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
36
|
-
var module = __webpack_module_cache__[moduleId] = {
|
|
37
|
-
exports: {}
|
|
38
|
-
};
|
|
39
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
40
|
-
return module.exports;
|
|
41
|
-
}
|
|
42
|
-
var core_ = __webpack_require__("@rspack/core");
|
|
43
|
-
var external_webpack_ = __webpack_require__("webpack");
|
|
44
|
-
__webpack_require__("src/types/index");
|
|
45
|
-
var external_colors_js_ = __webpack_require__("./colors");
|
|
46
|
-
var external_html_webpack_plugin_ = __webpack_require__("html-webpack-plugin");
|
|
47
|
-
var __webpack_exports__HtmlWebpackPlugin = external_html_webpack_plugin_["default"];
|
|
48
|
-
var __webpack_exports__colors = external_colors_js_["default"];
|
|
49
|
-
var __webpack_exports__rspack = core_.rspack;
|
|
50
|
-
var __webpack_exports__webpack = external_webpack_["default"];
|
|
15
|
+
var __webpack_exports__HtmlWebpackPlugin = __WEBPACK_EXTERNAL_MODULE_html_webpack_plugin_e07f62c9__["default"];
|
|
16
|
+
var __webpack_exports__colors = __WEBPACK_EXTERNAL_MODULE__colors_js_b738ede3__["default"];
|
|
17
|
+
var __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack;
|
|
18
|
+
var __webpack_exports__webpack = __WEBPACK_EXTERNAL_MODULE_webpack__["default"];
|
|
51
19
|
export { __webpack_exports__HtmlWebpackPlugin as HtmlWebpackPlugin, __webpack_exports__colors as colors, __webpack_exports__rspack as rspack, __webpack_exports__webpack as webpack };
|
|
@@ -24,7 +24,7 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
default: ()=>
|
|
27
|
+
default: ()=>loader
|
|
28
28
|
});
|
|
29
29
|
const external_node_buffer_namespaceObject = require("node:buffer");
|
|
30
30
|
const external_lightningcss_namespaceObject = require("lightningcss");
|
|
@@ -49,7 +49,7 @@ async function LightningcssLoader(source, prevSourceMap) {
|
|
|
49
49
|
done(error);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
const
|
|
52
|
+
const loader = LightningcssLoader;
|
|
53
53
|
exports["default"] = __webpack_exports__["default"];
|
|
54
54
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
55
55
|
"default"
|
|
@@ -25,7 +25,7 @@ var __webpack_exports__ = {};
|
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
LightningcssMinifyPlugin: ()=>LightningcssMinifyPlugin,
|
|
28
|
-
default: ()=>
|
|
28
|
+
default: ()=>minimizer
|
|
29
29
|
});
|
|
30
30
|
const external_node_buffer_namespaceObject = require("node:buffer");
|
|
31
31
|
const external_lightningcss_namespaceObject = require("lightningcss");
|
|
@@ -81,11 +81,11 @@ class LightningcssMinifyPlugin {
|
|
|
81
81
|
var _opts_implementation;
|
|
82
82
|
_define_property(this, "options", void 0);
|
|
83
83
|
_define_property(this, "transform", void 0);
|
|
84
|
-
this.transform = (null
|
|
84
|
+
this.transform = (null == (_opts_implementation = opts.implementation) ? void 0 : _opts_implementation.transform) ?? external_lightningcss_namespaceObject.transform;
|
|
85
85
|
this.options = opts;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
const
|
|
88
|
+
const minimizer = LightningcssMinifyPlugin;
|
|
89
89
|
exports.LightningcssMinifyPlugin = __webpack_exports__.LightningcssMinifyPlugin;
|
|
90
90
|
exports["default"] = __webpack_exports__["default"];
|
|
91
91
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
@@ -54,9 +54,9 @@ class LightningcssMinifyPlugin {
|
|
|
54
54
|
var _opts_implementation;
|
|
55
55
|
_define_property(this, "options", void 0);
|
|
56
56
|
_define_property(this, "transform", void 0);
|
|
57
|
-
this.transform = (null
|
|
57
|
+
this.transform = (null == (_opts_implementation = opts.implementation) ? void 0 : _opts_implementation.transform) ?? __WEBPACK_EXTERNAL_MODULE_lightningcss__.transform;
|
|
58
58
|
this.options = opts;
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
export { LightningcssMinifyPlugin,
|
|
61
|
+
const minimizer = LightningcssMinifyPlugin;
|
|
62
|
+
export { LightningcssMinifyPlugin, minimizer as default };
|
package/dist/logger.cjs
CHANGED
|
@@ -33,7 +33,7 @@ var __webpack_require__ = {};
|
|
|
33
33
|
var __webpack_exports__ = {};
|
|
34
34
|
__webpack_require__.r(__webpack_exports__);
|
|
35
35
|
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
-
logger: ()=>
|
|
36
|
+
logger: ()=>logger_logger
|
|
37
37
|
});
|
|
38
38
|
const external_node_readline_namespaceObject = require("node:readline");
|
|
39
39
|
var external_node_readline_default = /*#__PURE__*/ __webpack_require__.n(external_node_readline_namespaceObject);
|
|
@@ -96,7 +96,7 @@ const createLogger = ()=>{
|
|
|
96
96
|
});
|
|
97
97
|
return logger;
|
|
98
98
|
};
|
|
99
|
-
const
|
|
99
|
+
const logger_logger = createLogger();
|
|
100
100
|
exports.logger = __webpack_exports__.logger;
|
|
101
101
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
102
102
|
"logger"
|
package/dist/logger.js
CHANGED
package/dist/openBrowser.cjs
CHANGED
|
@@ -54,7 +54,7 @@ var __webpack_exports__ = {};
|
|
|
54
54
|
const external_node_path_namespaceObject = require("node:path");
|
|
55
55
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
56
56
|
const external_logger_cjs_namespaceObject = require("./logger.cjs");
|
|
57
|
-
const
|
|
57
|
+
const openBrowser_open = __webpack_require__("open");
|
|
58
58
|
async function openBrowser(url) {
|
|
59
59
|
const supportedChromiumBrowsers = [
|
|
60
60
|
'Google Chrome Canary',
|
|
@@ -79,7 +79,7 @@ var __webpack_exports__ = {};
|
|
|
79
79
|
external_logger_cjs_namespaceObject.logger.error(err);
|
|
80
80
|
}
|
|
81
81
|
try {
|
|
82
|
-
|
|
82
|
+
openBrowser_open(url).catch(()=>{});
|
|
83
83
|
return true;
|
|
84
84
|
} catch (err) {
|
|
85
85
|
external_logger_cjs_namespaceObject.logger.error(err);
|
package/dist/openBrowser.js
CHANGED
|
@@ -21,8 +21,8 @@ function __webpack_require__(moduleId) {
|
|
|
21
21
|
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
22
22
|
return module.exports;
|
|
23
23
|
}
|
|
24
|
-
var
|
|
25
|
-
const
|
|
24
|
+
var openBrowser_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
25
|
+
const openBrowser_open = __webpack_require__("open");
|
|
26
26
|
async function openBrowser(url) {
|
|
27
27
|
const supportedChromiumBrowsers = [
|
|
28
28
|
'Google Chrome Canary',
|
|
@@ -39,7 +39,7 @@ async function openBrowser(url) {
|
|
|
39
39
|
const openedBrowser = supportedChromiumBrowsers.find((b)=>ps.includes(b));
|
|
40
40
|
if (openedBrowser) {
|
|
41
41
|
await execAsync(`osascript openChrome.applescript "${encodeURI(url)}" "${openedBrowser}"`, {
|
|
42
|
-
cwd: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(
|
|
42
|
+
cwd: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(openBrowser_dirname, '../bin')
|
|
43
43
|
});
|
|
44
44
|
return true;
|
|
45
45
|
}
|
|
@@ -47,7 +47,7 @@ async function openBrowser(url) {
|
|
|
47
47
|
__WEBPACK_EXTERNAL_MODULE__logger_js_c2be5186__.logger.error(err);
|
|
48
48
|
}
|
|
49
49
|
try {
|
|
50
|
-
|
|
50
|
+
openBrowser_open(url).catch(()=>{});
|
|
51
51
|
return true;
|
|
52
52
|
} catch (err) {
|
|
53
53
|
__WEBPACK_EXTERNAL_MODULE__logger_js_c2be5186__.logger.error(err);
|
package/dist/prebundleDeps.cjs
CHANGED
|
@@ -112,10 +112,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
112
112
|
assets
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
|
-
if (external_node_fs_default().existsSync(outDir))
|
|
116
|
-
resolve(getResult());
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
115
|
+
if (external_node_fs_default().existsSync(outDir)) return void resolve(getResult());
|
|
119
116
|
(0, external_utils_cjs_namespaceObject.removeDir)(pkgDir);
|
|
120
117
|
count.total++;
|
|
121
118
|
updateProgress();
|
|
@@ -235,7 +232,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
235
232
|
});
|
|
236
233
|
});
|
|
237
234
|
});
|
|
238
|
-
const userOptions = (0, external_utils_cjs_namespaceObject.isPlainObject)(null
|
|
235
|
+
const userOptions = (0, external_utils_cjs_namespaceObject.isPlainObject)(null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.prebundle) ? unpackConfig.dev.prebundle : {};
|
|
239
236
|
const packageJson = JSON.parse(external_node_fs_default().readFileSync(external_node_path_default().resolve(root, 'package.json'), 'utf-8'));
|
|
240
237
|
const existExternals = getExistExternals(unpackConfig.externals);
|
|
241
238
|
const excludeDeps = [
|
|
@@ -247,10 +244,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
247
244
|
const needBundleDeps = shouldIncludeDeps.map((pkgName)=>{
|
|
248
245
|
const packageJson = JSON.parse(external_node_fs_default().readFileSync(external_node_path_default().resolve(root, 'node_modules', pkgName, 'package.json'), 'utf-8'));
|
|
249
246
|
const entry = getPkgEntry(packageJson);
|
|
250
|
-
if (!entry)
|
|
251
|
-
noEntryDeps.push(pkgName);
|
|
252
|
-
return;
|
|
253
|
-
}
|
|
247
|
+
if (!entry) return void noEntryDeps.push(pkgName);
|
|
254
248
|
return {
|
|
255
249
|
name: pkgName,
|
|
256
250
|
entry: external_node_path_default().resolve(root, 'node_modules', pkgName, entry),
|
package/dist/prebundleDeps.js
CHANGED
|
@@ -71,10 +71,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
71
71
|
assets
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
-
if (__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(outDir))
|
|
75
|
-
resolve(getResult());
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
74
|
+
if (__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(outDir)) return void resolve(getResult());
|
|
78
75
|
(0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.removeDir)(pkgDir);
|
|
79
76
|
count.total++;
|
|
80
77
|
updateProgress();
|
|
@@ -194,7 +191,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
194
191
|
});
|
|
195
192
|
});
|
|
196
193
|
});
|
|
197
|
-
const userOptions = (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.isPlainObject)(null
|
|
194
|
+
const userOptions = (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.isPlainObject)(null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.prebundle) ? unpackConfig.dev.prebundle : {};
|
|
198
195
|
const packageJson = JSON.parse(__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].readFileSync(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(root, 'package.json'), 'utf-8'));
|
|
199
196
|
const existExternals = getExistExternals(unpackConfig.externals);
|
|
200
197
|
const excludeDeps = [
|
|
@@ -206,10 +203,7 @@ const prebundleDeps = async ({ unpackConfig })=>{
|
|
|
206
203
|
const needBundleDeps = shouldIncludeDeps.map((pkgName)=>{
|
|
207
204
|
const packageJson = JSON.parse(__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].readFileSync(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(root, 'node_modules', pkgName, 'package.json'), 'utf-8'));
|
|
208
205
|
const entry = getPkgEntry(packageJson);
|
|
209
|
-
if (!entry)
|
|
210
|
-
noEntryDeps.push(pkgName);
|
|
211
|
-
return;
|
|
212
|
-
}
|
|
206
|
+
if (!entry) return void noEntryDeps.push(pkgName);
|
|
213
207
|
return {
|
|
214
208
|
name: pkgName,
|
|
215
209
|
entry: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(root, 'node_modules', pkgName, entry),
|
package/dist/run/dev.cjs
CHANGED
|
@@ -52,12 +52,12 @@ async function bundlerDev(originalUnpackConfig) {
|
|
|
52
52
|
var _unpackConfig_dev, _unpackConfig_server, _unpackConfig_server1, _unpackConfig_dev1;
|
|
53
53
|
let unpackConfig = originalUnpackConfig;
|
|
54
54
|
const bundler = 'rspack' === unpackConfig.bundler ? core_namespaceObject.rspack : external_webpack_default();
|
|
55
|
-
if (null
|
|
55
|
+
if (null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.prebundle) unpackConfig = await (0, external_prebundleDeps_cjs_namespaceObject.prebundleDeps)({
|
|
56
56
|
unpackConfig
|
|
57
57
|
});
|
|
58
58
|
const config = await (0, index_cjs_namespaceObject.getBundlerConfig)(unpackConfig);
|
|
59
59
|
const compiler = bundler(config);
|
|
60
|
-
const port = await (0, external_utils_cjs_namespaceObject.getPort)(null
|
|
60
|
+
const port = await (0, external_utils_cjs_namespaceObject.getPort)(null == (_unpackConfig_server = unpackConfig.server) ? void 0 : _unpackConfig_server.port);
|
|
61
61
|
const middleware = core_namespaceObject.experiments.lazyCompilationMiddleware(compiler, config.experiments.lazyCompilation);
|
|
62
62
|
const devServerOptions = {
|
|
63
63
|
hot: true,
|
|
@@ -66,9 +66,9 @@ async function bundlerDev(originalUnpackConfig) {
|
|
|
66
66
|
client: {
|
|
67
67
|
overlay: false
|
|
68
68
|
},
|
|
69
|
-
proxy: null
|
|
69
|
+
proxy: null == (_unpackConfig_server1 = unpackConfig.server) ? void 0 : _unpackConfig_server1.proxy,
|
|
70
70
|
devMiddleware: {
|
|
71
|
-
writeToDisk: null
|
|
71
|
+
writeToDisk: null == (_unpackConfig_dev1 = unpackConfig.dev) ? void 0 : _unpackConfig_dev1.writeToDisk
|
|
72
72
|
},
|
|
73
73
|
setupMiddlewares (other) {
|
|
74
74
|
return [
|
|
@@ -78,7 +78,7 @@ async function bundlerDev(originalUnpackConfig) {
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
const server = new (external_webpack_dev_server_default())(devServerOptions, compiler);
|
|
81
|
-
external_logger_cjs_namespaceObject.logger.greet(` ${external_colors_cjs_default().green(`${external_colors_cjs_default().bold('UNPACK')} v1.7.
|
|
81
|
+
external_logger_cjs_namespaceObject.logger.greet(` ${external_colors_cjs_default().green(`${external_colors_cjs_default().bold('UNPACK')} v1.7.12`)} ${external_colors_cjs_default().dim(`ready in ${external_colors_cjs_default().reset(external_colors_cjs_default().bold(Math.ceil(performance.now() - global.__unpack_start_time)))}ms`)}\n`);
|
|
82
82
|
printAddressUrls(port);
|
|
83
83
|
await server.start();
|
|
84
84
|
external_global_cjs_namespaceObject.restartCleaners.push(async ()=>await server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())));
|