@unpackjs/core 4.7.4 → 4.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -2555,7 +2555,7 @@ let CSS_MODULES_LOCAL_IDENT_NAME = '[path][name]__[local]--[hash:5]', CSS_MODULE
|
|
|
2555
2555
|
<body>
|
|
2556
2556
|
<div id="${mountId}"></div>
|
|
2557
2557
|
</body>
|
|
2558
|
-
</html>`,
|
|
2558
|
+
</html>`, TS_REGEX = /\.[jt]s$/, TSX_REGEX = /\.[jt]sx$/, SCRIPT_REGEX = /\.[jt]sx?$/, CSS_REGEX = /\.css$/i, LESS_REGEX = /\.less$/i, SASS_REGEX = /\.s[ac]ss$/i, CSS_MODULES_RESOURCE_QUERY_REGEX = /[?&]module(?:[=&]|$)/, external_path_ = __webpack_require__("path"), external_fs_ = __webpack_require__("fs");
|
|
2559
2559
|
var __require = createRequire(import.meta.url);
|
|
2560
2560
|
let SLASHES_REGEX = /[\\/]/g;
|
|
2561
2561
|
function convertSlashes(path, separator) {
|
|
@@ -4668,7 +4668,7 @@ class JsMinifyPlugin {
|
|
|
4668
4668
|
apply(compiler) {
|
|
4669
4669
|
let meta = JSON.stringify({
|
|
4670
4670
|
name: jsMinify_PLUGIN_NAME,
|
|
4671
|
-
version: "4.7.
|
|
4671
|
+
version: "4.7.5",
|
|
4672
4672
|
options: this.minifyOptions
|
|
4673
4673
|
});
|
|
4674
4674
|
compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
|
|
@@ -5026,7 +5026,10 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
5026
5026
|
configFile: tsconfigPath,
|
|
5027
5027
|
references: 'auto'
|
|
5028
5028
|
} : void 0,
|
|
5029
|
-
alias:
|
|
5029
|
+
alias: {
|
|
5030
|
+
...unpackConfig.resolve?.alias,
|
|
5031
|
+
'@swc/helpers': node_path.dirname(require.resolve('@swc/helpers/package.json'))
|
|
5032
|
+
},
|
|
5030
5033
|
extensionAlias: {
|
|
5031
5034
|
'.js': [
|
|
5032
5035
|
'.js',
|
|
@@ -5402,7 +5405,7 @@ async function unpackDev(originalConfig) {
|
|
|
5402
5405
|
...middlewares
|
|
5403
5406
|
]);
|
|
5404
5407
|
let server = new RspackDevServer(devServerOptions, compiler);
|
|
5405
|
-
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.7.
|
|
5408
|
+
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.7.5`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - getUnpackStartTime()))} ${colors.dim('ms')}\n`), printServerUrls({
|
|
5406
5409
|
port,
|
|
5407
5410
|
host: unpackConfig.server.host,
|
|
5408
5411
|
base: unpackConfig.base
|
|
@@ -5416,7 +5419,7 @@ async function unpackDev(originalConfig) {
|
|
|
5416
5419
|
function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'unpack' }) {
|
|
5417
5420
|
let _context = {
|
|
5418
5421
|
callerName,
|
|
5419
|
-
version: "4.7.
|
|
5422
|
+
version: "4.7.5",
|
|
5420
5423
|
cachePath: 'node_modules/.unpack'
|
|
5421
5424
|
}, resolveConfig = (mode)=>{
|
|
5422
5425
|
let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, root, alias, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, plugin, tsconfigPath, root1, uno, generated, configOrPath, defaults, VIRTUAL_UNO_CSS_ID, rootDir, isMpa, unoConfig, configFilePath, unpackConfigPath, tokens, requestedLayers, tasks, unocssCacheDir, tokensCachePath, layersCachePath, timeCachePath, configHashCachePath, generatedCachePath, bundlerCacheDir, cachedTokensSize, cachedLayersSize, isCompiling, resolveUnocssConfig, flushTasks, getVirtualModuleContent, hash, restoreSkipCode, applyUnoTransformers, options, rootPath1, registerCode, namesCode, defaultConfig = {
|
|
@@ -5831,7 +5834,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
5831
5834
|
},
|
|
5832
5835
|
transform: {
|
|
5833
5836
|
filter: {
|
|
5834
|
-
test:
|
|
5837
|
+
test: TS_REGEX
|
|
5835
5838
|
},
|
|
5836
5839
|
handler: (code)=>code.includes('import.meta.glob') ? code.replace(/import\.meta\.glob\s*\(\s*(\[[\s\S]*?\]|(['"])([^'"]+)\2)\s*(?:,\s*({[\s\S]*?}))?\s*\)/g, (_, patternGroup, __, pattern, rawOptions)=>{
|
|
5837
5840
|
if (patternGroup.trim().startsWith('[')) {
|
|
@@ -6038,7 +6041,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
6038
6041
|
type: 'asset'
|
|
6039
6042
|
},
|
|
6040
6043
|
{
|
|
6041
|
-
test:
|
|
6044
|
+
test: TS_REGEX,
|
|
6042
6045
|
use: [
|
|
6043
6046
|
{
|
|
6044
6047
|
loader: 'builtin:swc-loader',
|
|
@@ -6049,7 +6052,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
6049
6052
|
]
|
|
6050
6053
|
},
|
|
6051
6054
|
{
|
|
6052
|
-
test:
|
|
6055
|
+
test: TSX_REGEX,
|
|
6053
6056
|
use: [
|
|
6054
6057
|
{
|
|
6055
6058
|
loader: 'builtin:swc-loader',
|
|
@@ -6142,7 +6145,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
6142
6145
|
...existingExternals
|
|
6143
6146
|
], shouldTransformDeepImport && (plugin.transform = {
|
|
6144
6147
|
filter: {
|
|
6145
|
-
test:
|
|
6148
|
+
test: TSX_REGEX
|
|
6146
6149
|
},
|
|
6147
6150
|
handler: (code)=>SPECIAL_NO_ENTRY_DEPS.some((pkg)=>code.includes(pkg)) ? code.replace(deepImportRegex, (_, localName, importPath, pkgName)=>{
|
|
6148
6151
|
let exportName = pathToExportIdentifier(importPath.slice(pkgName.length + 1));
|
|
@@ -6464,7 +6467,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
6464
6467
|
let layer = match[2];
|
|
6465
6468
|
layer && requestedLayers.add(layer);
|
|
6466
6469
|
}
|
|
6467
|
-
if (
|
|
6470
|
+
if (TS_REGEX.test(id) && !code.includes('@unocss-include')) return null;
|
|
6468
6471
|
let transformedCode = code, preTransformed = await applyUnoTransformers(transformedCode, id, 'pre');
|
|
6469
6472
|
null != preTransformed && (transformedCode = preTransformed);
|
|
6470
6473
|
let defaultTransformed = await applyUnoTransformers(transformedCode, id, 'default');
|
|
@@ -6596,7 +6599,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
6596
6599
|
let mode = watch ? 'development' : 'production';
|
|
6597
6600
|
setNodeEnv(mode);
|
|
6598
6601
|
let config = resolveConfig(mode);
|
|
6599
|
-
console.log(colors.brand(`${callerName} v4.7.
|
|
6602
|
+
console.log(colors.brand(`${callerName} v4.7.5`), colors.cyan(`building for ${mode}...`)), await unpackBuild(config);
|
|
6600
6603
|
},
|
|
6601
6604
|
dev: async ()=>{
|
|
6602
6605
|
setUnpackStartTime(performance.now());
|
|
@@ -7788,8 +7791,8 @@ function runCLI() {
|
|
|
7788
7791
|
logger_logger.clear(), logger_logger.info(`${node_path.basename(file)} changed, restarting server...`), await watcher.close(), await cleanUpBeforeRestart(), startServer(options);
|
|
7789
7792
|
});
|
|
7790
7793
|
});
|
|
7791
|
-
devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.7.
|
|
7794
|
+
devCommand.option('-o, --open [url]', 'Open browser on startup').option('--port <port>', 'Specify port').option('--host', 'Expose hostname').action(startServer), cli.help(), cli.version("4.7.5"), cli.parse();
|
|
7792
7795
|
}
|
|
7793
7796
|
let launch_editor = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js");
|
|
7794
7797
|
var launch_editor_default_0 = __webpack_require__.n(launch_editor)(), src_CSS_MODULES_NAMED_EXPORT = !1;
|
|
7795
|
-
export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_RESOURCE_QUERY_REGEX, CSS_REGEX, DEV_DEFAULT_FILENAME,
|
|
7798
|
+
export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, CSS_MODULES_RESOURCE_QUERY_REGEX, CSS_REGEX, DEV_DEFAULT_FILENAME, LESS_REGEX, LOCALHOST, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, SASS_REGEX, SCRIPT_REGEX, TEMPLATE_CONTENT, TSX_REGEX, TS_REGEX, addRestartCleaner, applyHtmlTagDescriptors, cleanUpBeforeRestart, clearLine, colors, convertBasicAnsiColors, createChokidar, createUnpack, debounce, defineConfig, dist_default_0 as mergeConfig, dist_glob as glob, emptyDir, ensureDir, esVersionToBrowserslist, findExists, getAddressUrls, getCompiledPkgPath, getCurrentUnpackConfig, getDevServerPort, getFilesContentHash, getHtmlTemplateOrContent, getIpv4Interfaces, getNodeEnv, getOrSetDefault, getPathInJs, getPort, getTime, getUnpackStartTime, getUserDepPath, getUserDepVersion, globSync, isBoolean, isDebug, isDev, isEmptyDir, isFileSync, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isRegExp, isUndefined, launch_editor_default_0 as launchEditor, loadConfig, loadConfigFromFile, logUpdate, logger_LogColor as LogColor, logger_logger as logger, normalizePublicPath, openBrowser, pLimit, pathToExportIdentifier, prettyTime, printServerUrls, removeDir, renderHtmlTagDescriptor, resolveConfigPath, rspack, runCLI, setCurrentUnpackConfig, setDevServer, setDevServerPort, setNodeEnv, setUnpackStartTime, src_CSS_MODULES_NAMED_EXPORT as CSS_MODULES_NAMED_EXPORT, trackPerformance, utils_isDevServer as isDevServer, utils_isProd as isProd, utils_isString as isString, utils_isWin as isWin, utils_set as set };
|
|
@@ -21,8 +21,8 @@ export declare const TEMPLATE_CONTENT: ({ title, headTag, mountId }: {
|
|
|
21
21
|
headTag?: string | undefined;
|
|
22
22
|
mountId?: string | undefined;
|
|
23
23
|
}) => string;
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
24
|
+
export declare const TS_REGEX: RegExp;
|
|
25
|
+
export declare const TSX_REGEX: RegExp;
|
|
26
26
|
export declare const SCRIPT_REGEX: RegExp;
|
|
27
27
|
export declare const CSS_REGEX: RegExp;
|
|
28
28
|
export declare const LESS_REGEX: RegExp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rspack-config/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAmB3D,wBAAsB,eAAe,CAAC,oBAAoB,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rspack-config/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAmB3D,wBAAsB,eAAe,CAAC,oBAAoB,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAsM/F"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unpackjs/core",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.5",
|
|
4
4
|
"description": "An Rspack-based build tool",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"@rsdoctor/rspack-plugin": "1.5.3",
|
|
32
32
|
"@rspack/core": "2.0.0-beta.5",
|
|
33
33
|
"@rspack/dev-server": "1.2.1",
|
|
34
|
+
"@swc/helpers": "0.5.19",
|
|
34
35
|
"@tailwindcss/webpack": "4.2.1",
|
|
35
36
|
"jiti": "2.6.1",
|
|
36
37
|
"oxc-minify": "0.116.0",
|