@unpackjs/core 1.7.10 → 1.7.11
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 +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 +23 -23
- package/dist/bundler-config/index.js +23 -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.js +2 -2
- 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 +3 -3
|
@@ -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.11`)} ${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())));
|
package/dist/run/dev.js
CHANGED
|
@@ -14,12 +14,12 @@ async function bundlerDev(originalUnpackConfig) {
|
|
|
14
14
|
var _unpackConfig_dev, _unpackConfig_server, _unpackConfig_server1, _unpackConfig_dev1;
|
|
15
15
|
let unpackConfig = originalUnpackConfig;
|
|
16
16
|
const bundler = 'rspack' === unpackConfig.bundler ? __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.rspack : __WEBPACK_EXTERNAL_MODULE_webpack__["default"];
|
|
17
|
-
if (null
|
|
17
|
+
if (null == (_unpackConfig_dev = unpackConfig.dev) ? void 0 : _unpackConfig_dev.prebundle) unpackConfig = await (0, __WEBPACK_EXTERNAL_MODULE__prebundleDeps_js_142f70dc__.prebundleDeps)({
|
|
18
18
|
unpackConfig
|
|
19
19
|
});
|
|
20
20
|
const config = await (0, __WEBPACK_EXTERNAL_MODULE__bundler_config_index_js_e76188c2__.getBundlerConfig)(unpackConfig);
|
|
21
21
|
const compiler = bundler(config);
|
|
22
|
-
const port = await (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getPort)(null
|
|
22
|
+
const port = await (0, __WEBPACK_EXTERNAL_MODULE__utils_js_db66b9f7__.getPort)(null == (_unpackConfig_server = unpackConfig.server) ? void 0 : _unpackConfig_server.port);
|
|
23
23
|
const middleware = __WEBPACK_EXTERNAL_MODULE__rspack_core_e0096ff7__.experiments.lazyCompilationMiddleware(compiler, config.experiments.lazyCompilation);
|
|
24
24
|
const devServerOptions = {
|
|
25
25
|
hot: true,
|
|
@@ -28,9 +28,9 @@ async function bundlerDev(originalUnpackConfig) {
|
|
|
28
28
|
client: {
|
|
29
29
|
overlay: false
|
|
30
30
|
},
|
|
31
|
-
proxy: null
|
|
31
|
+
proxy: null == (_unpackConfig_server1 = unpackConfig.server) ? void 0 : _unpackConfig_server1.proxy,
|
|
32
32
|
devMiddleware: {
|
|
33
|
-
writeToDisk: null
|
|
33
|
+
writeToDisk: null == (_unpackConfig_dev1 = unpackConfig.dev) ? void 0 : _unpackConfig_dev1.writeToDisk
|
|
34
34
|
},
|
|
35
35
|
setupMiddlewares (other) {
|
|
36
36
|
return [
|
|
@@ -40,7 +40,7 @@ async function bundlerDev(originalUnpackConfig) {
|
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
const server = new __WEBPACK_EXTERNAL_MODULE_webpack_dev_server_0dd3124e__["default"](devServerOptions, compiler);
|
|
43
|
-
__WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.greet(` ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].green(`${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].bold('UNPACK')} v1.7.
|
|
43
|
+
__WEBPACK_EXTERNAL_MODULE__logger_js_ff791b17__.logger.greet(` ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].green(`${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].bold('UNPACK')} v1.7.11`)} ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].dim(`ready in ${__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].reset(__WEBPACK_EXTERNAL_MODULE__colors_js_1d4535d6__["default"].bold(Math.ceil(performance.now() - global.__unpack_start_time)))}ms`)}\n`);
|
|
44
44
|
printAddressUrls(port);
|
|
45
45
|
await server.start();
|
|
46
46
|
__WEBPACK_EXTERNAL_MODULE__global_js_83d0ec5c__.restartCleaners.push(async ()=>await server.stop(), ()=>new Promise((resolve)=>compiler.close(()=>resolve())));
|
|
@@ -49,7 +49,7 @@ var __webpack_exports__ = {};
|
|
|
49
49
|
__webpack_require__.r(__webpack_exports__);
|
|
50
50
|
__webpack_require__.d(__webpack_exports__, {
|
|
51
51
|
wrapQuotes: ()=>wrapQuotes,
|
|
52
|
-
default: ()=>
|
|
52
|
+
default: ()=>loader,
|
|
53
53
|
isInNodeModules: ()=>isInNodeModules
|
|
54
54
|
});
|
|
55
55
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
@@ -133,21 +133,15 @@ var __webpack_exports__ = {};
|
|
|
133
133
|
const cssModuleExport = 'declare const cssExports: CssExports;\nexport default cssExports;\n';
|
|
134
134
|
return `${bannerMessage}\n${cssModuleToInterface(keys)}\n${cssModuleExport}`;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function loader(content, ...rest) {
|
|
137
137
|
const { failed, success } = makeDoneHandlers(this.async(), content, rest);
|
|
138
138
|
const { resourcePath } = this;
|
|
139
139
|
const { mode = 'emit', modules } = this.getOptions() || {};
|
|
140
|
-
if (!validModes.includes(mode)) {
|
|
141
|
-
failed(new Error(`Invalid mode option: ${mode}`));
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
140
|
+
if (!validModes.includes(mode)) return void failed(new Error(`Invalid mode option: ${mode}`));
|
|
144
141
|
if (!(0, external_utils_cjs_namespaceObject.isCSSModules)({
|
|
145
142
|
resourcePath,
|
|
146
143
|
modules
|
|
147
|
-
}) || isInNodeModules(resourcePath))
|
|
148
|
-
success();
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
144
|
+
}) || isInNodeModules(resourcePath)) return void success();
|
|
151
145
|
const cssModuleInterfaceFilename = filenameToTypingsFilename(resourcePath);
|
|
152
146
|
const { read, write } = makeFileHandlers(cssModuleInterfaceFilename);
|
|
153
147
|
const namedExport = external_constants_cjs_namespaceObject.CSS_NAMED_EXPORT;
|
|
@@ -95,21 +95,15 @@ function codegen(keys, namedExport) {
|
|
|
95
95
|
const cssModuleExport = 'declare const cssExports: CssExports;\nexport default cssExports;\n';
|
|
96
96
|
return `${bannerMessage}\n${cssModuleToInterface(keys)}\n${cssModuleExport}`;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function loader(content, ...rest) {
|
|
99
99
|
const { failed, success } = makeDoneHandlers(this.async(), content, rest);
|
|
100
100
|
const { resourcePath } = this;
|
|
101
101
|
const { mode = 'emit', modules } = this.getOptions() || {};
|
|
102
|
-
if (!validModes.includes(mode)) {
|
|
103
|
-
failed(new Error(`Invalid mode option: ${mode}`));
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
102
|
+
if (!validModes.includes(mode)) return void failed(new Error(`Invalid mode option: ${mode}`));
|
|
106
103
|
if (!(0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.isCSSModules)({
|
|
107
104
|
resourcePath,
|
|
108
105
|
modules
|
|
109
|
-
}) || isInNodeModules(resourcePath))
|
|
110
|
-
success();
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
106
|
+
}) || isInNodeModules(resourcePath)) return void success();
|
|
113
107
|
const cssModuleInterfaceFilename = filenameToTypingsFilename(resourcePath);
|
|
114
108
|
const { read, write } = makeFileHandlers(cssModuleInterfaceFilename);
|
|
115
109
|
const namedExport = __WEBPACK_EXTERNAL_MODULE__constants_js_59e7fa1b__.CSS_NAMED_EXPORT;
|
|
@@ -134,4 +128,4 @@ function loader_rslib_entry_(content, ...rest) {
|
|
|
134
128
|
});
|
|
135
129
|
});
|
|
136
130
|
}
|
|
137
|
-
export {
|
|
131
|
+
export { loader as default, isInNodeModules, wrapQuotes };
|
|
@@ -90,7 +90,7 @@ class PluginTypedCssModules {
|
|
|
90
90
|
var _this_userOptions;
|
|
91
91
|
return (0, external_utils_cjs_namespaceObject.isCSSModules)({
|
|
92
92
|
resourcePath: file,
|
|
93
|
-
modules: null
|
|
93
|
+
modules: null == (_this_userOptions = this.userOptions) ? void 0 : _this_userOptions.modules
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
96
|
const doTask = incremental ? generateTypingIfNecessary : writeFile;
|
|
@@ -53,7 +53,7 @@ class PluginTypedCssModules {
|
|
|
53
53
|
var _this_userOptions;
|
|
54
54
|
return (0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.isCSSModules)({
|
|
55
55
|
resourcePath: file,
|
|
56
|
-
modules: null
|
|
56
|
+
modules: null == (_this_userOptions = this.userOptions) ? void 0 : _this_userOptions.modules
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
const doTask = incremental ? generateTypingIfNecessary : writeFile;
|
package/dist/types/logger.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import __rslib_shim_module__ from 'module';
|
|
2
2
|
/*#__PURE__*/ import.meta.url;
|
|
3
|
-
var
|
|
3
|
+
var logger_LogColor = /*#__PURE__*/ function(LogColor) {
|
|
4
4
|
LogColor["error"] = "red";
|
|
5
5
|
LogColor["warn"] = "yellow";
|
|
6
6
|
LogColor["info"] = "cyan";
|
|
@@ -10,4 +10,4 @@ var logger_rslib_entry_LogColor = /*#__PURE__*/ function(LogColor) {
|
|
|
10
10
|
LogColor["debug"] = "dim";
|
|
11
11
|
return LogColor;
|
|
12
12
|
}({});
|
|
13
|
-
export {
|
|
13
|
+
export { logger_LogColor as LogColor };
|
package/dist/utils.cjs
CHANGED
|
@@ -60,7 +60,7 @@ var __webpack_exports__ = {};
|
|
|
60
60
|
isDev: ()=>isDev,
|
|
61
61
|
getAddressUrls: ()=>getAddressUrls,
|
|
62
62
|
getCompiledPkgPath: ()=>getCompiledPkgPath,
|
|
63
|
-
isDevServer: ()=>
|
|
63
|
+
isDevServer: ()=>utils_isDevServer,
|
|
64
64
|
isFunction: ()=>isFunction,
|
|
65
65
|
getUserDepVersion: ()=>getUserDepVersion,
|
|
66
66
|
isObject: ()=>isObject,
|
|
@@ -106,8 +106,8 @@ var __webpack_exports__ = {};
|
|
|
106
106
|
process.env.DEV_SERVER = isDevServer ? 'true' : 'false';
|
|
107
107
|
};
|
|
108
108
|
const isDev = ()=>'development' === getNodeEnv();
|
|
109
|
-
const
|
|
110
|
-
const isWatch = ()=>isDev() && !
|
|
109
|
+
const utils_isDevServer = ()=>'true' === process.env.DEV_SERVER;
|
|
110
|
+
const isWatch = ()=>isDev() && !utils_isDevServer();
|
|
111
111
|
const isProd = ()=>'production' === getNodeEnv();
|
|
112
112
|
const isWin = ()=>'win32' === process.platform;
|
|
113
113
|
const isString = (str)=>'string' == typeof str;
|
package/dist/utils.js
CHANGED
|
@@ -29,7 +29,7 @@ function __webpack_require__(moduleId) {
|
|
|
29
29
|
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
30
30
|
return module.exports;
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var utils_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
|
|
33
33
|
const portfinder = __webpack_require__("../compiled/portfinder/index.js");
|
|
34
34
|
const { merge } = __webpack_require__("../compiled/webpack-merge/index.js");
|
|
35
35
|
const getNodeEnv = ()=>process.env.NODE_ENV;
|
|
@@ -40,8 +40,8 @@ const setDevServer = (isDevServer)=>{
|
|
|
40
40
|
process.env.DEV_SERVER = isDevServer ? 'true' : 'false';
|
|
41
41
|
};
|
|
42
42
|
const isDev = ()=>'development' === getNodeEnv();
|
|
43
|
-
const
|
|
44
|
-
const isWatch = ()=>isDev() && !
|
|
43
|
+
const utils_isDevServer = ()=>'true' === process.env.DEV_SERVER;
|
|
44
|
+
const isWatch = ()=>isDev() && !utils_isDevServer();
|
|
45
45
|
const isProd = ()=>'production' === getNodeEnv();
|
|
46
46
|
const isWin = ()=>'win32' === process.platform;
|
|
47
47
|
const isString = (str)=>'string' == typeof str;
|
|
@@ -87,7 +87,7 @@ const getPort = (startPort)=>new Promise((resolve)=>{
|
|
|
87
87
|
resolve(port);
|
|
88
88
|
});
|
|
89
89
|
});
|
|
90
|
-
const getCompiledPkgPath = (packageName)=>__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(
|
|
90
|
+
const getCompiledPkgPath = (packageName)=>__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(utils_dirname, '../compiled', packageName);
|
|
91
91
|
const getUserDepPath = (root, deps)=>{
|
|
92
92
|
const dependencies = Array.isArray(deps) ? deps : [
|
|
93
93
|
deps
|
|
@@ -205,4 +205,4 @@ const removeDir = (dir)=>{
|
|
|
205
205
|
force: true
|
|
206
206
|
});
|
|
207
207
|
};
|
|
208
|
-
export { clearLine, debounce, getAddressUrls, getCompiledPkgPath, getIpv4Interfaces, getNodeEnv, getPathInJs, getPort, getTime, getUserDepPath, getUserDepVersion, getValueByPath, isBoolean, isDev,
|
|
208
|
+
export { clearLine, debounce, getAddressUrls, getCompiledPkgPath, getIpv4Interfaces, getNodeEnv, getPathInJs, getPort, getTime, getUserDepPath, getUserDepVersion, getValueByPath, isBoolean, isDev, utils_isDevServer as isDevServer, isFunction, isObject, isPlainObject, isProd, isRegExp, isString, isUndefined, isWatch, isWin, logUpdate, mergeConfig, prettyTime, removeDir, setDevServer, setNodeEnv, setValueByPath, trackPerformance };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unpackjs/core",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.11",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"webpack-merge": "6.0.1"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
-
"@rspack/core": "1.3.
|
|
80
|
+
"@rspack/core": "1.3.4",
|
|
81
81
|
"@types/less": "3.0.8",
|
|
82
82
|
"chokidar": "4.0.3",
|
|
83
83
|
"copy-webpack-plugin": "13.0.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"tinyglobby": "0.2.12",
|
|
97
97
|
"ts-checker-rspack-plugin": "1.1.1",
|
|
98
98
|
"typed-css-modules": "0.9.1",
|
|
99
|
-
"webpack": "5.
|
|
99
|
+
"webpack": "5.99.5",
|
|
100
100
|
"webpack-dev-server": "5.2.1"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|