@unpackjs/core 4.7.0 → 4.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +123 -120
- package/dist/transformLoader.js +4 -4
- package/dist-types/constants.d.ts +3 -0
- package/dist-types/constants.d.ts.map +1 -1
- package/dist-types/createUnpack.d.ts.map +1 -1
- package/dist-types/plugin.d.ts +3 -3
- package/dist-types/plugin.d.ts.map +1 -1
- package/dist-types/plugins/buildAnalyze.d.ts +3 -0
- package/dist-types/plugins/buildAnalyze.d.ts.map +1 -0
- package/dist-types/plugins/detectCircular.d.ts +3 -0
- package/dist-types/plugins/detectCircular.d.ts.map +1 -0
- package/dist-types/plugins/prebundle.d.ts.map +1 -1
- package/dist-types/plugins/target.d.ts +3 -0
- package/dist-types/plugins/target.d.ts.map +1 -0
- package/dist-types/plugins/typeCheck.d.ts +3 -0
- package/dist-types/plugins/typeCheck.d.ts.map +1 -0
- package/dist-types/rspack-config/css.d.ts.map +1 -1
- package/dist-types/rspack-config/helpers.d.ts +1 -11
- package/dist-types/rspack-config/helpers.d.ts.map +1 -1
- package/dist-types/rspack-config/index.d.ts.map +1 -1
- package/dist-types/rspack-config/nativeCss.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist-types/rspack-config/buildAnalyze.d.ts +0 -6
- package/dist-types/rspack-config/buildAnalyze.d.ts.map +0 -1
- package/dist-types/rspack-config/detectCircular.d.ts +0 -6
- package/dist-types/rspack-config/detectCircular.d.ts.map +0 -1
- package/dist-types/rspack-config/typeCheck.d.ts +0 -6
- package/dist-types/rspack-config/typeCheck.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1217,7 +1217,7 @@ let CSS_MODULES_LOCAL_IDENT_NAME = '[path][name]__[local]--[hash:5]', CSS_MODULE
|
|
|
1217
1217
|
<body>
|
|
1218
1218
|
<div id="${mountId}"></div>
|
|
1219
1219
|
</body>
|
|
1220
|
-
</html>`, JS_REGEX = /\.[jt]s$/, JSX_REGEX = /\.[jt]sx$/, SCRIPT_REGEX = /\.[jt]sx
|
|
1220
|
+
</html>`, JS_REGEX = /\.[jt]s$/, JSX_REGEX = /\.[jt]sx$/, SCRIPT_REGEX = /\.[jt]sx?$/, CSS_REGEX = /\.css$/i, LESS_REGEX = /\.less$/i, SASS_REGEX = /\.s[ac]ss$/i;
|
|
1221
1221
|
var utils_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
1222
1222
|
let getNodeEnv = ()=>process.env.NODE_ENV, setNodeEnv = (env)=>{
|
|
1223
1223
|
process.env.NODE_ENV = env;
|
|
@@ -1757,7 +1757,16 @@ let COMPRESSIBLE_REGEX = /\.(?:js|css|html|json|svg|txt|xml|xhtml|wasm|manifest|
|
|
|
1757
1757
|
if ('function' == typeof symbolId) return symbolId(name, filePath);
|
|
1758
1758
|
let id = (symbolId || 'icon-[dir]-[name]').replace(/\[name\]/g, name).replace(/\[dir\]/g, dir);
|
|
1759
1759
|
return id.replace(/--+/g, '-').replace(/^-+|-+$/g, '');
|
|
1760
|
-
},
|
|
1760
|
+
}, BROWSERSLIST_CONFIG_FILES = [
|
|
1761
|
+
'.browserslistrc',
|
|
1762
|
+
'.browserslistrc.json',
|
|
1763
|
+
'.browserslistrc.yaml',
|
|
1764
|
+
'.browserslistrc.yml',
|
|
1765
|
+
'browserslist',
|
|
1766
|
+
'browserslist.config.js',
|
|
1767
|
+
'browserslist.config.cjs',
|
|
1768
|
+
'browserslist.config.mjs'
|
|
1769
|
+
], dist = __webpack_require__("../../node_modules/.pnpm/webpack-merge@6.0.1/node_modules/webpack-merge/dist/index.js");
|
|
1761
1770
|
var dist_default = __webpack_require__.n(dist), dist_default_0 = dist_default();
|
|
1762
1771
|
let UNOCSS_CONFIG_FILES = [
|
|
1763
1772
|
'unocss.config.mjs',
|
|
@@ -1772,7 +1781,9 @@ let UNOCSS_CONFIG_FILES = [
|
|
|
1772
1781
|
if (!view) return (css)=>css;
|
|
1773
1782
|
let prefix = {};
|
|
1774
1783
|
return view.trim().replace(/(\\*)\\(["'`\\])/g, (_, bs, char)=>(prefix[char] = bs.replace(/\\\\/g, '\\'), '')), (css)=>css.replace(/["'`\\]/g, (v)=>(prefix[v] || '') + v);
|
|
1775
|
-
}, DOTENV_LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm, TRANSFORM_TIMING_STORE = Symbol.for('unpack:transformTimingMap'), PLUGIN_CONTEXT_STORE = Symbol.for('unpack:pluginContextStore'), globalScope = globalThis
|
|
1784
|
+
}, DOTENV_LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm, TRANSFORM_TIMING_STORE = Symbol.for('unpack:transformTimingMap'), PLUGIN_CONTEXT_STORE = Symbol.for('unpack:pluginContextStore'), globalScope = globalThis;
|
|
1785
|
+
globalScope[TRANSFORM_TIMING_STORE] ??= new WeakMap(), globalScope[PLUGIN_CONTEXT_STORE] ??= new WeakMap();
|
|
1786
|
+
let flattenUnpackPlugins = ()=>getCurrentUnpackConfig().plugins?.flat(1 / 0) || [];
|
|
1776
1787
|
function getNormalizedPluginsByHook(hook) {
|
|
1777
1788
|
let pluginMap = new Map();
|
|
1778
1789
|
flattenUnpackPlugins().forEach((plugin)=>{
|
|
@@ -1809,11 +1820,7 @@ let createPluginHookTimer = (pluginName, hook)=>{
|
|
|
1809
1820
|
logger_logger.debug(`${colors.magenta('[plugin]')} ${colors.cyan(pluginName)} ${colors.blue(hook)} ${colors.dim('in')} ${colors.yellow(`${duration.toFixed(2)}ms`)}`);
|
|
1810
1821
|
}
|
|
1811
1822
|
};
|
|
1812
|
-
}, transformTimingMap = globalScope[TRANSFORM_TIMING_STORE]
|
|
1813
|
-
globalScope[TRANSFORM_TIMING_STORE] = transformTimingMap;
|
|
1814
|
-
let pluginContextStore = globalScope[PLUGIN_CONTEXT_STORE] ?? new WeakMap();
|
|
1815
|
-
globalScope[PLUGIN_CONTEXT_STORE] = pluginContextStore;
|
|
1816
|
-
let createPluginContext = (plugin)=>{
|
|
1823
|
+
}, transformTimingMap = globalScope[TRANSFORM_TIMING_STORE], pluginContextStore = globalScope[PLUGIN_CONTEXT_STORE], createPluginContext = (plugin)=>{
|
|
1817
1824
|
let cached = pluginContextStore.get(plugin);
|
|
1818
1825
|
if (cached) return cached;
|
|
1819
1826
|
let context = {
|
|
@@ -1866,21 +1873,6 @@ function applyPluginsByHookSync(hook, runner) {
|
|
|
1866
1873
|
}
|
|
1867
1874
|
}
|
|
1868
1875
|
}
|
|
1869
|
-
async function applyBuildAnalyzeConfig({ config, unpackConfig }) {
|
|
1870
|
-
let { RsdoctorRspackPlugin } = await import("@rsdoctor/rspack-plugin");
|
|
1871
|
-
return config.plugins?.push(new RsdoctorRspackPlugin({
|
|
1872
|
-
linter: {
|
|
1873
|
-
rules: {
|
|
1874
|
-
'ecma-version-check': [
|
|
1875
|
-
'Warn',
|
|
1876
|
-
{
|
|
1877
|
-
targets: esVersionToBrowserslist(unpackConfig.build.target)
|
|
1878
|
-
}
|
|
1879
|
-
]
|
|
1880
|
-
}
|
|
1881
|
-
}
|
|
1882
|
-
})), config.devtool = 'source-map', config;
|
|
1883
|
-
}
|
|
1884
1876
|
async function getBuildDependencies(root) {
|
|
1885
1877
|
let rootPackageJson = node_path.join(root, 'package.json'), browserslistConfig = node_path.join(root, '.browserslistrc'), tsconfigPath = node_path.join(root, 'tsconfig.json'), buildDependencies = {};
|
|
1886
1878
|
await isFileExists(rootPackageJson) && (buildDependencies.packageJson = [
|
|
@@ -1932,10 +1924,7 @@ let getOutputFilename = ({ type, hash, async })=>{
|
|
|
1932
1924
|
return async ? 'js' === type ? FILENAME.jsAsync : FILENAME.cssAsync : FILENAME[type];
|
|
1933
1925
|
}, getCssLoader = (unpackConfig)=>unpackConfig.css?.transformer === 'lightningcss' ? {
|
|
1934
1926
|
loader: 'builtin:lightningcss-loader',
|
|
1935
|
-
options:
|
|
1936
|
-
targets: esVersionToBrowserslist(unpackConfig.build.target),
|
|
1937
|
-
...unpackConfig.css?.lightningcssLoader
|
|
1938
|
-
}
|
|
1927
|
+
options: unpackConfig.css?.lightningcssLoader
|
|
1939
1928
|
} : {
|
|
1940
1929
|
loader: getCompiledPkgPath('postcss-loader'),
|
|
1941
1930
|
options: {
|
|
@@ -1995,7 +1984,7 @@ class JsMinifyPlugin {
|
|
|
1995
1984
|
apply(compiler) {
|
|
1996
1985
|
let meta = JSON.stringify({
|
|
1997
1986
|
name: jsMinify_PLUGIN_NAME,
|
|
1998
|
-
version: "4.7.
|
|
1987
|
+
version: "4.7.1",
|
|
1999
1988
|
options: this.minifyOptions
|
|
2000
1989
|
});
|
|
2001
1990
|
compiler.hooks.compilation.tap(jsMinify_PLUGIN_NAME, (compilation)=>{
|
|
@@ -2208,35 +2197,6 @@ class RegisterHooksPlugin {
|
|
|
2208
2197
|
});
|
|
2209
2198
|
}
|
|
2210
2199
|
}
|
|
2211
|
-
async function applyTypeCheckConfig({ config, unpackConfig }) {
|
|
2212
|
-
let { TsCheckerRspackPlugin } = await import("ts-checker-rspack-plugin"), tsconfigPath = node_path.resolve(unpackConfig.root, 'tsconfig.json');
|
|
2213
|
-
return config.plugins?.push(new TsCheckerRspackPlugin({
|
|
2214
|
-
typescript: {
|
|
2215
|
-
mode: 'readonly',
|
|
2216
|
-
memoryLimit: 8192,
|
|
2217
|
-
configFile: tsconfigPath,
|
|
2218
|
-
typescriptPath: require.resolve("typescript", {
|
|
2219
|
-
paths: [
|
|
2220
|
-
unpackConfig.root
|
|
2221
|
-
]
|
|
2222
|
-
})
|
|
2223
|
-
},
|
|
2224
|
-
issue: {
|
|
2225
|
-
exclude: [
|
|
2226
|
-
({ file = '' })=>NODE_MODULES_REGEX.test(file)
|
|
2227
|
-
]
|
|
2228
|
-
},
|
|
2229
|
-
logger: {
|
|
2230
|
-
log (message) {
|
|
2231
|
-
let count = +(/(\d+) errors?/.exec(message)?.[1] || 0);
|
|
2232
|
-
count > 0 && console.log(`Found ${colors.red(colors.bold(`${count} ${1 === count ? 'error' : 'errors'}`))}`);
|
|
2233
|
-
},
|
|
2234
|
-
error (message) {
|
|
2235
|
-
message.includes('RpcExitError') || message.includes('out of memory') || console.log(convertBasicAnsiColors(message.replace(/ERROR/g, 'Type Error')));
|
|
2236
|
-
}
|
|
2237
|
-
}
|
|
2238
|
-
})), config;
|
|
2239
|
-
}
|
|
2240
2200
|
var rspack_config_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
2241
2201
|
async function getRspackConfig(originalUnpackConfig) {
|
|
2242
2202
|
setCurrentUnpackConfig(originalUnpackConfig);
|
|
@@ -2416,16 +2376,8 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
2416
2376
|
moduleIds: isDev() ? 'named' : 'deterministic',
|
|
2417
2377
|
minimize: !!unpackConfig.build?.minify && utils_isProd(),
|
|
2418
2378
|
minimizer: [
|
|
2419
|
-
new JsMinifyPlugin(
|
|
2420
|
-
|
|
2421
|
-
target: unpackConfig.build.target
|
|
2422
|
-
}
|
|
2423
|
-
}, minifyOptions.oxc || {})),
|
|
2424
|
-
new rspack.LightningCssMinimizerRspackPlugin(dist_default()({
|
|
2425
|
-
minimizerOptions: {
|
|
2426
|
-
targets: esVersionToBrowserslist(unpackConfig.build.target)
|
|
2427
|
-
}
|
|
2428
|
-
}, minifyOptions.lightningcss || {}))
|
|
2379
|
+
new JsMinifyPlugin(minifyOptions.oxc),
|
|
2380
|
+
new rspack.LightningCssMinimizerRspackPlugin(minifyOptions.lightningcss)
|
|
2429
2381
|
]
|
|
2430
2382
|
},
|
|
2431
2383
|
watchOptions: {
|
|
@@ -2497,15 +2449,15 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
2497
2449
|
]
|
|
2498
2450
|
};
|
|
2499
2451
|
};
|
|
2500
|
-
return config.module.rules.push(createStyleRule(
|
|
2452
|
+
return config.module.rules.push(createStyleRule(CSS_REGEX, [
|
|
2501
2453
|
getCssLoader(unpackConfig),
|
|
2502
2454
|
unpackConfig.css?.tailwindcss && {
|
|
2503
2455
|
loader: require.resolve('@tailwindcss/webpack')
|
|
2504
2456
|
}
|
|
2505
|
-
])), config.module.rules.push(createStyleRule(
|
|
2457
|
+
])), config.module.rules.push(createStyleRule(LESS_REGEX, [
|
|
2506
2458
|
getCssLoader(unpackConfig),
|
|
2507
2459
|
getLessLoader(unpackConfig)
|
|
2508
|
-
])), config.module.rules.push(createStyleRule(
|
|
2460
|
+
])), config.module.rules.push(createStyleRule(SASS_REGEX, [
|
|
2509
2461
|
getCssLoader(unpackConfig),
|
|
2510
2462
|
getSassLoader(unpackConfig)
|
|
2511
2463
|
])), config;
|
|
@@ -2551,7 +2503,7 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
2551
2503
|
}),
|
|
2552
2504
|
ignoreOrder: !0
|
|
2553
2505
|
})), config.module.rules.push({
|
|
2554
|
-
test:
|
|
2506
|
+
test: LESS_REGEX,
|
|
2555
2507
|
use: [
|
|
2556
2508
|
...getCommonRules({
|
|
2557
2509
|
importLoaders: 2
|
|
@@ -2560,7 +2512,7 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
2560
2512
|
getLessLoader(unpackConfig)
|
|
2561
2513
|
]
|
|
2562
2514
|
}), config.module.rules.push({
|
|
2563
|
-
test:
|
|
2515
|
+
test: CSS_REGEX,
|
|
2564
2516
|
use: [
|
|
2565
2517
|
...getCommonRules({
|
|
2566
2518
|
importLoaders: unpackConfig.css?.tailwindcss ? 2 : 1
|
|
@@ -2571,7 +2523,7 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
2571
2523
|
}
|
|
2572
2524
|
].filter(Boolean)
|
|
2573
2525
|
}), config.module.rules.push({
|
|
2574
|
-
test:
|
|
2526
|
+
test: SASS_REGEX,
|
|
2575
2527
|
use: [
|
|
2576
2528
|
...getCommonRules({
|
|
2577
2529
|
importLoaders: 2
|
|
@@ -2590,45 +2542,6 @@ async function getRspackConfig(originalUnpackConfig) {
|
|
|
2590
2542
|
config,
|
|
2591
2543
|
unpackConfig,
|
|
2592
2544
|
envFilePaths
|
|
2593
|
-
})), unpackConfig.performance?.buildAnalyze && utils_isProd() && (config = await applyBuildAnalyzeConfig({
|
|
2594
|
-
config,
|
|
2595
|
-
unpackConfig
|
|
2596
|
-
})), unpackConfig.typeCheck && isDev() && isTS && (config = await applyTypeCheckConfig({
|
|
2597
|
-
config,
|
|
2598
|
-
unpackConfig
|
|
2599
|
-
})), unpackConfig.detectCircular && (config = function({ config, unpackConfig }) {
|
|
2600
|
-
let circularCount = 0, circularDependencyPlugin = new rspack.CircularDependencyRspackPlugin({
|
|
2601
|
-
exclude: NODE_MODULES_REGEX,
|
|
2602
|
-
onStart () {
|
|
2603
|
-
circularCount = 0;
|
|
2604
|
-
},
|
|
2605
|
-
onDetected (_, modules) {
|
|
2606
|
-
var paths;
|
|
2607
|
-
let arrow, lastIndex;
|
|
2608
|
-
circularCount++, logger_logger.warn('circular dependency detected:'), paths = modules.map((module)=>{
|
|
2609
|
-
let filePath = module.replace(/^.*!/, ''), relativePath = node_path.relative(unpackConfig.root, filePath);
|
|
2610
|
-
return relativePath.startsWith('..') ? filePath : relativePath;
|
|
2611
|
-
}).slice(0, -1), console.log(''), arrow = colors.dim('↳ '), lastIndex = paths.length - 1, paths.forEach((p, i)=>{
|
|
2612
|
-
switch(i){
|
|
2613
|
-
case 0:
|
|
2614
|
-
console.log(` ${p}`);
|
|
2615
|
-
break;
|
|
2616
|
-
case lastIndex:
|
|
2617
|
-
console.log(` ${arrow}${p} ${colors.yellow(colors.dim('(cycle introduced)'))}`);
|
|
2618
|
-
break;
|
|
2619
|
-
default:
|
|
2620
|
-
console.log(` ${arrow}${p}`);
|
|
2621
|
-
}
|
|
2622
|
-
}), console.log(` ${arrow}${paths[0]}`), console.log('');
|
|
2623
|
-
},
|
|
2624
|
-
onEnd () {
|
|
2625
|
-
circularCount > 0 && console.log('Found', colors.yellow(colors.bold(`${circularCount} circular ${1 === circularCount ? 'dependency' : 'dependencies'}`)));
|
|
2626
|
-
}
|
|
2627
|
-
});
|
|
2628
|
-
return config.plugins?.push(circularDependencyPlugin), config;
|
|
2629
|
-
}({
|
|
2630
|
-
config,
|
|
2631
|
-
unpackConfig
|
|
2632
2545
|
})), await applyPluginsByHook('rspackConfig', async (impl, context)=>{
|
|
2633
2546
|
config = await impl.call(context, config, {
|
|
2634
2547
|
unpackConfig,
|
|
@@ -2757,7 +2670,7 @@ async function unpackDev(originalConfig) {
|
|
|
2757
2670
|
...middlewares
|
|
2758
2671
|
]);
|
|
2759
2672
|
let server = new RspackDevServer(devServerOptions, compiler);
|
|
2760
|
-
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.7.
|
|
2673
|
+
await server.start(), logger_logger.greet(` ${colors.brand(`${colors.bold(unpackConfig._context.callerName.toUpperCase())} v4.7.1`)} ${colors.dim('ready in')} ${colors.bold(Math.ceil(performance.now() - getUnpackStartTime()))} ${colors.dim('ms')}\n`), printServerUrls({
|
|
2761
2674
|
port,
|
|
2762
2675
|
host: unpackConfig.server.host,
|
|
2763
2676
|
base: unpackConfig.base
|
|
@@ -2771,10 +2684,10 @@ async function unpackDev(originalConfig) {
|
|
|
2771
2684
|
function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'unpack' }) {
|
|
2772
2685
|
let _context = {
|
|
2773
2686
|
callerName,
|
|
2774
|
-
version: "4.7.
|
|
2687
|
+
version: "4.7.1",
|
|
2775
2688
|
cachePath: 'node_modules/.unpack'
|
|
2776
2689
|
}, resolveConfig = (mode)=>{
|
|
2777
|
-
let rootPath, outputPath, basePath, cachedTraceMap, fs, isValidMethodName, parseFrame, formatOriginalLocation, formatFullStack, resolveErrorLocationAndStack, root, alias, shouldTransformDeepImport, preJsAssets, jsAssets, cssAssets, bundledDepsCachePath, deepImportPkgPattern, deepImportRegex, plugin, 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 = {
|
|
2690
|
+
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 = {
|
|
2778
2691
|
root: cwd,
|
|
2779
2692
|
base: '/',
|
|
2780
2693
|
sourceMap: 'production' !== mode && 'cheap-module-source-map',
|
|
@@ -3314,7 +3227,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3314
3227
|
]
|
|
3315
3228
|
},
|
|
3316
3229
|
{
|
|
3317
|
-
test:
|
|
3230
|
+
test: LESS_REGEX,
|
|
3318
3231
|
type: 'css/auto',
|
|
3319
3232
|
use: [
|
|
3320
3233
|
{
|
|
@@ -3329,7 +3242,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3329
3242
|
]
|
|
3330
3243
|
},
|
|
3331
3244
|
{
|
|
3332
|
-
test:
|
|
3245
|
+
test: SASS_REGEX,
|
|
3333
3246
|
type: 'css/auto',
|
|
3334
3247
|
use: [
|
|
3335
3248
|
{
|
|
@@ -3343,6 +3256,10 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3343
3256
|
}
|
|
3344
3257
|
}
|
|
3345
3258
|
]
|
|
3259
|
+
},
|
|
3260
|
+
{
|
|
3261
|
+
test: CSS_REGEX,
|
|
3262
|
+
type: 'css/auto'
|
|
3346
3263
|
}
|
|
3347
3264
|
]
|
|
3348
3265
|
},
|
|
@@ -3438,6 +3355,92 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3438
3355
|
}), config;
|
|
3439
3356
|
}
|
|
3440
3357
|
}),
|
|
3358
|
+
{
|
|
3359
|
+
name: 'unpack:type-check',
|
|
3360
|
+
apply: (config, { command })=>(tsconfigPath = node_path.resolve(config.root, 'tsconfig.json'), node_fs.existsSync(tsconfigPath) && 'dev' === command && config.typeCheck),
|
|
3361
|
+
async rspackConfig (config, { unpackConfig }) {
|
|
3362
|
+
let { TsCheckerRspackPlugin } = await import("ts-checker-rspack-plugin");
|
|
3363
|
+
return config.plugins.push(new TsCheckerRspackPlugin({
|
|
3364
|
+
typescript: {
|
|
3365
|
+
mode: 'readonly',
|
|
3366
|
+
memoryLimit: 8192,
|
|
3367
|
+
configFile: tsconfigPath,
|
|
3368
|
+
typescriptPath: require.resolve("typescript", {
|
|
3369
|
+
paths: [
|
|
3370
|
+
unpackConfig.root
|
|
3371
|
+
]
|
|
3372
|
+
})
|
|
3373
|
+
},
|
|
3374
|
+
issue: {
|
|
3375
|
+
exclude: [
|
|
3376
|
+
({ file = '' })=>NODE_MODULES_REGEX.test(file)
|
|
3377
|
+
]
|
|
3378
|
+
},
|
|
3379
|
+
logger: {
|
|
3380
|
+
log (message) {
|
|
3381
|
+
let count = +(/(\d+) errors?/.exec(message)?.[1] || 0);
|
|
3382
|
+
count > 0 && console.log(`Found ${colors.red(colors.bold(`${count} ${1 === count ? 'error' : 'errors'}`))}`);
|
|
3383
|
+
},
|
|
3384
|
+
error (message) {
|
|
3385
|
+
message.includes('RpcExitError') || message.includes('out of memory') || console.log(convertBasicAnsiColors(message.replace(/ERROR/g, 'Type Error')));
|
|
3386
|
+
}
|
|
3387
|
+
}
|
|
3388
|
+
})), config;
|
|
3389
|
+
}
|
|
3390
|
+
},
|
|
3391
|
+
{
|
|
3392
|
+
name: 'unpack:target',
|
|
3393
|
+
rspackConfig: (config)=>(config.target = 'browserslist', config),
|
|
3394
|
+
configResolved (config) {
|
|
3395
|
+
let root = config.root, packageJsonPath = node_path.join(root, 'package.json');
|
|
3396
|
+
if (!node_fs.existsSync(packageJsonPath) || BROWSERSLIST_CONFIG_FILES.some((file)=>node_fs.existsSync(node_path.join(root, file)))) return;
|
|
3397
|
+
let packageJson = JSON.parse(node_fs.readFileSync(packageJsonPath, 'utf-8'));
|
|
3398
|
+
'browserslist' in packageJson || (packageJson.browserslist = esVersionToBrowserslist(config.build.target), node_fs.writeFileSync(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`));
|
|
3399
|
+
}
|
|
3400
|
+
},
|
|
3401
|
+
{
|
|
3402
|
+
name: 'unpack:build-analyze',
|
|
3403
|
+
apply: (config, { command })=>'build' === command && config.performance?.buildAnalyze,
|
|
3404
|
+
async rspackConfig (config) {
|
|
3405
|
+
let { RsdoctorRspackPlugin } = await import("@rsdoctor/rspack-plugin");
|
|
3406
|
+
return config.plugins.push(new RsdoctorRspackPlugin()), config.devtool = 'source-map', config;
|
|
3407
|
+
}
|
|
3408
|
+
},
|
|
3409
|
+
{
|
|
3410
|
+
name: 'unpack:detect-circular',
|
|
3411
|
+
apply: (config)=>config.detectCircular,
|
|
3412
|
+
rspackConfig (config, { unpackConfig }) {
|
|
3413
|
+
let circularCount = 0;
|
|
3414
|
+
return config.plugins.push(new rspack.CircularDependencyRspackPlugin({
|
|
3415
|
+
exclude: NODE_MODULES_REGEX,
|
|
3416
|
+
onStart () {
|
|
3417
|
+
circularCount = 0;
|
|
3418
|
+
},
|
|
3419
|
+
onDetected (_, modules) {
|
|
3420
|
+
var paths;
|
|
3421
|
+
let arrow, lastIndex;
|
|
3422
|
+
circularCount++, logger_logger.warn('circular dependency detected:'), paths = modules.map((module)=>{
|
|
3423
|
+
let filePath = module.replace(/^.*!/, ''), relativePath = node_path.relative(unpackConfig.root, filePath);
|
|
3424
|
+
return relativePath.startsWith('..') ? filePath : relativePath;
|
|
3425
|
+
}).slice(0, -1), console.log(''), arrow = colors.dim('↳ '), lastIndex = paths.length - 1, paths.forEach((p, i)=>{
|
|
3426
|
+
switch(i){
|
|
3427
|
+
case 0:
|
|
3428
|
+
console.log(` ${p}`);
|
|
3429
|
+
break;
|
|
3430
|
+
case lastIndex:
|
|
3431
|
+
console.log(` ${arrow}${p} ${colors.yellow(colors.dim('(cycle introduced)'))}`);
|
|
3432
|
+
break;
|
|
3433
|
+
default:
|
|
3434
|
+
console.log(` ${arrow}${p}`);
|
|
3435
|
+
}
|
|
3436
|
+
}), console.log(` ${arrow}${paths[0]}`), console.log('');
|
|
3437
|
+
},
|
|
3438
|
+
onEnd () {
|
|
3439
|
+
circularCount > 0 && console.log('Found', colors.yellow(colors.bold(`${circularCount} circular ${1 === circularCount ? 'dependency' : 'dependencies'}`)));
|
|
3440
|
+
}
|
|
3441
|
+
})), config;
|
|
3442
|
+
}
|
|
3443
|
+
},
|
|
3441
3444
|
(root1 = '', {
|
|
3442
3445
|
name: 'unpack:file-size',
|
|
3443
3446
|
apply: (config, { mode })=>'production' === mode && config.performance?.printFileSize,
|
|
@@ -3760,7 +3763,7 @@ function createUnpack({ cwd = process.cwd(), config: userConfig, callerName = 'u
|
|
|
3760
3763
|
let mode = watch ? 'development' : 'production';
|
|
3761
3764
|
setNodeEnv(mode);
|
|
3762
3765
|
let config = resolveConfig(mode);
|
|
3763
|
-
console.log(colors.brand(`${callerName} v4.7.
|
|
3766
|
+
console.log(colors.brand(`${callerName} v4.7.1`), colors.cyan(`building for ${mode}...`)), await unpackBuild(config);
|
|
3764
3767
|
},
|
|
3765
3768
|
dev: async ()=>{
|
|
3766
3769
|
setUnpackStartTime(performance.now());
|
|
@@ -3914,8 +3917,8 @@ function runCLI() {
|
|
|
3914
3917
|
logger_logger.clear(), logger_logger.info(`${node_path.basename(file)} changed, restarting server...`), await watcher.close(), await cleanUpBeforeRestart(), startServer(options);
|
|
3915
3918
|
});
|
|
3916
3919
|
});
|
|
3917
|
-
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.
|
|
3920
|
+
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.1"), cli.parse();
|
|
3918
3921
|
}
|
|
3919
3922
|
let launch_editor = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js");
|
|
3920
3923
|
var launch_editor_default_0 = __webpack_require__.n(launch_editor)(), src_CSS_MODULES_NAMED_EXPORT = !1;
|
|
3921
|
-
export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, DEV_DEFAULT_FILENAME, JSX_REGEX, JS_REGEX, LOCALHOST, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, SCRIPT_REGEX, TEMPLATE_CONTENT, addRestartCleaner, applyHtmlTagDescriptors, cleanUpBeforeRestart, clearLine, colors, convertBasicAnsiColors, createChokidar, createUnpack, debounce, defineConfig, dist_default_0 as mergeConfig, emptyDir, ensureDir, esVersionToBrowserslist, external_tinyglobby_glob as glob, findExists, getAddressUrls, getCompiledPkgPath, getCurrentUnpackConfig, getDevServerPort, getFilesContentHash, getHtmlTemplateOrContent, getIpv4Interfaces, getNodeEnv, getOrSetDefault, getPathInJs, getPort, getTime, getUnpackStartTime, getUserDepPath, getUserDepVersion, globSync, isBoolean, isDebug, isDev, isEmptyDir, isFileExists, isFileSync, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isRegExp, isString, isUndefined, isWin, launch_editor_default_0 as launchEditor, loadConfig, loadConfigFromFile, logUpdate, logger_LogColor as LogColor, logger_logger as logger, normalizePublicPath, openBrowser, pLimit, pathExists, pathToExportIdentifier, prettyTime, printServerUrls, removeDir, renderHtmlTagDescriptor, resolveConfigPath, rspack, runCLI, set, setCurrentUnpackConfig, setDevServer, setDevServerPort, setNodeEnv, setUnpackStartTime, src_CSS_MODULES_NAMED_EXPORT as CSS_MODULES_NAMED_EXPORT, trackPerformance, utils_isDevServer as isDevServer, utils_isProd as isProd };
|
|
3924
|
+
export { ALL_INTERFACES_IPV4, CSS_MODULES_EXPORTS_CONVENTION, CSS_MODULES_LOCAL_IDENT_NAME, CSS_REGEX, DEV_DEFAULT_FILENAME, JSX_REGEX, JS_REGEX, LESS_REGEX, LOCALHOST, NODE_MODULES_REGEX, PROD_DEFAULT_FILENAME, SASS_REGEX, SCRIPT_REGEX, TEMPLATE_CONTENT, addRestartCleaner, applyHtmlTagDescriptors, cleanUpBeforeRestart, clearLine, colors, convertBasicAnsiColors, createChokidar, createUnpack, debounce, defineConfig, dist_default_0 as mergeConfig, emptyDir, ensureDir, esVersionToBrowserslist, external_tinyglobby_glob as glob, findExists, getAddressUrls, getCompiledPkgPath, getCurrentUnpackConfig, getDevServerPort, getFilesContentHash, getHtmlTemplateOrContent, getIpv4Interfaces, getNodeEnv, getOrSetDefault, getPathInJs, getPort, getTime, getUnpackStartTime, getUserDepPath, getUserDepVersion, globSync, isBoolean, isDebug, isDev, isEmptyDir, isFileExists, isFileSync, isFunction, isNodeVersionAtLeast, isObject, isPlainObject, isRegExp, isString, isUndefined, isWin, launch_editor_default_0 as launchEditor, loadConfig, loadConfigFromFile, logUpdate, logger_LogColor as LogColor, logger_logger as logger, normalizePublicPath, openBrowser, pLimit, pathExists, pathToExportIdentifier, prettyTime, printServerUrls, removeDir, renderHtmlTagDescriptor, resolveConfigPath, rspack, runCLI, set, setCurrentUnpackConfig, setDevServer, setDevServerPort, setNodeEnv, setUnpackStartTime, src_CSS_MODULES_NAMED_EXPORT as CSS_MODULES_NAMED_EXPORT, trackPerformance, utils_isDevServer as isDevServer, utils_isProd as isProd };
|
package/dist/transformLoader.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
let TRANSFORM_TIMING_STORE = Symbol.for('unpack:transformTimingMap'), PLUGIN_CONTEXT_STORE = Symbol.for('unpack:pluginContextStore'), globalScope = globalThis
|
|
2
|
-
globalScope[TRANSFORM_TIMING_STORE]
|
|
3
|
-
let
|
|
4
|
-
globalScope[PLUGIN_CONTEXT_STORE]
|
|
1
|
+
let TRANSFORM_TIMING_STORE = Symbol.for('unpack:transformTimingMap'), PLUGIN_CONTEXT_STORE = Symbol.for('unpack:pluginContextStore'), globalScope = globalThis;
|
|
2
|
+
globalScope[TRANSFORM_TIMING_STORE] ??= new WeakMap(), globalScope[PLUGIN_CONTEXT_STORE] ??= new WeakMap();
|
|
3
|
+
let transformTimingMap = globalScope[TRANSFORM_TIMING_STORE];
|
|
4
|
+
globalScope[PLUGIN_CONTEXT_STORE];
|
|
5
5
|
export default function(content) {
|
|
6
6
|
let callback = this.async(), { handler, pluginName } = this.getOptions(), id = `${this.resourcePath}${this.resourceQuery || ''}`;
|
|
7
7
|
(async ()=>{
|
|
@@ -24,4 +24,7 @@ export declare const TEMPLATE_CONTENT: ({ title, headTag, mountId }: {
|
|
|
24
24
|
export declare const JS_REGEX: RegExp;
|
|
25
25
|
export declare const JSX_REGEX: RegExp;
|
|
26
26
|
export declare const SCRIPT_REGEX: RegExp;
|
|
27
|
+
export declare const CSS_REGEX: RegExp;
|
|
28
|
+
export declare const LESS_REGEX: RegExp;
|
|
29
|
+
export declare const SASS_REGEX: RegExp;
|
|
27
30
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,oCAAoC,CAAA;AAC7E,eAAO,MAAM,8BAA8B,eAAe,CAAA;AAC1D,eAAO,MAAM,wBAAwB,QAAQ,CAAA;AAC7C,eAAO,MAAM,oBAAoB;;;;;CAKhC,CAAA;AACD,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAA;AACD,eAAO,MAAM,kBAAkB,QAA2B,CAAA;AAC1D,eAAO,MAAM,mBAAmB,YAAY,CAAA;AAC5C,eAAO,MAAM,SAAS,cAAc,CAAA;AACpC,eAAO,MAAM,gBAAgB,GAAI;;;;CAA0C,WAa1E,CAAA;AACD,eAAO,MAAM,QAAQ,QAAa,CAAA;AAClC,eAAO,MAAM,SAAS,QAAc,CAAA;AACpC,eAAO,MAAM,YAAY,QAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,oCAAoC,CAAA;AAC7E,eAAO,MAAM,8BAA8B,eAAe,CAAA;AAC1D,eAAO,MAAM,wBAAwB,QAAQ,CAAA;AAC7C,eAAO,MAAM,oBAAoB;;;;;CAKhC,CAAA;AACD,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAA;AACD,eAAO,MAAM,kBAAkB,QAA2B,CAAA;AAC1D,eAAO,MAAM,mBAAmB,YAAY,CAAA;AAC5C,eAAO,MAAM,SAAS,cAAc,CAAA;AACpC,eAAO,MAAM,gBAAgB,GAAI;;;;CAA0C,WAa1E,CAAA;AACD,eAAO,MAAM,QAAQ,QAAa,CAAA;AAClC,eAAO,MAAM,SAAS,QAAc,CAAA;AACpC,eAAO,MAAM,YAAY,QAAe,CAAA;AACxC,eAAO,MAAM,SAAS,QAAY,CAAA;AAClC,eAAO,MAAM,UAAU,QAAa,CAAA;AACpC,eAAO,MAAM,UAAU,QAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createUnpack.d.ts","sourceRoot":"","sources":["../src/createUnpack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createUnpack.d.ts","sourceRoot":"","sources":["../src/createUnpack.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAW,YAAY,EAAiB,MAAM,SAAS,CAAA;AAoDnE,wBAAgB,YAAY,CAAC,EAC3B,GAAmB,EACnB,MAAM,EAAE,UAAU,EAClB,UAAqB,GACtB,EAAE;IACD,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;wBAkB4B;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;;;;;;EA8B/C"}
|
package/dist-types/plugin.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { PluginContext, UnpackPlugin, UnpackPluginHook } from './types';
|
|
1
|
+
import type { PluginContext, Rspack, UnpackPlugin, UnpackPluginHook } from './types';
|
|
2
2
|
export declare function getNormalizedPluginsByHook(hook: UnpackPluginHook): UnpackPlugin[];
|
|
3
3
|
type HookImpl<T extends UnpackPluginHook> = Exclude<UnpackPlugin[T], undefined>;
|
|
4
4
|
export declare const createPluginHookTimer: (pluginName: string, hook: UnpackPluginHook) => {
|
|
5
5
|
start: () => void;
|
|
6
6
|
end: () => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const addTransformTiming: (compilation:
|
|
9
|
-
export declare const flushTransformTiming: (compilation:
|
|
8
|
+
export declare const addTransformTiming: (compilation: Rspack.Compilation, pluginName: string, duration: number) => void;
|
|
9
|
+
export declare const flushTransformTiming: (compilation: Rspack.Compilation) => void;
|
|
10
10
|
export declare const createPluginContext: (plugin: UnpackPlugin) => PluginContext;
|
|
11
11
|
export declare function applyPluginsByHook<T extends UnpackPluginHook>(hook: T, runner: (impl: HookImpl<T>, context: PluginContext) => void | Promise<void>): Promise<void>;
|
|
12
12
|
export declare function applyPluginsByHookSync<T extends UnpackPluginHook>(hook: T, runner: (impl: HookImpl<T>, context: PluginContext) => void): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,aAAa,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA6CpG,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,EAAE,CAqBjF;AAED,KAAK,QAAQ,CAAC,CAAC,SAAS,gBAAgB,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;AAE/E,eAAO,MAAM,qBAAqB,GAAI,YAAY,MAAM,EAAE,MAAM,gBAAgB;;;CAa/E,CAAA;AAID,eAAO,MAAM,kBAAkB,GAC7B,aAAa,MAAM,CAAC,WAAW,EAC/B,YAAY,MAAM,EAClB,UAAU,MAAM,SASjB,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM,CAAC,WAAW,SASnE,CAAA;AAID,eAAO,MAAM,mBAAmB,GAAI,QAAQ,YAAY,KAAG,aAsB1D,CAAA;AAED,wBAAsB,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,EACjE,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAC1E,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,gBAAgB,EAC/D,IAAI,EAAE,CAAC,EACP,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,KAAK,IAAI,GAC1D,IAAI,CAkBN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildAnalyze.d.ts","sourceRoot":"","sources":["../../src/plugins/buildAnalyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,eAAO,MAAM,kBAAkB,QAAO,YAarC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detectCircular.d.ts","sourceRoot":"","sources":["../../src/plugins/detectCircular.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAyB7C,eAAO,MAAM,oBAAoB,QAAO,YAgDvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebundle.d.ts","sourceRoot":"","sources":["../../src/plugins/prebundle.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,WAAW,CAAA;AAkGnE,eAAO,MAAM,eAAe,QAAO,
|
|
1
|
+
{"version":3,"file":"prebundle.d.ts","sourceRoot":"","sources":["../../src/plugins/prebundle.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAwB,YAAY,EAAE,MAAM,WAAW,CAAA;AAkGnE,eAAO,MAAM,eAAe,QAAO,YAsZlC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../src/plugins/target.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAkB7C,eAAO,MAAM,YAAY,QAAO,YAkB/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeCheck.d.ts","sourceRoot":"","sources":["../../src/plugins/typeCheck.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE7C,eAAO,MAAM,eAAe,QAAO,YA4ClC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/rspack-config/css.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/rspack-config/css.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAU,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAUnE,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,YAAY,CA4Ef"}
|
|
@@ -9,17 +9,7 @@ export declare const getOutputFilename: ({ type, hash, async }: OutputFilename)
|
|
|
9
9
|
export declare const resolveRuleUse: (items: Array<Rspack.RuleSetUseItem | false | undefined>) => Rspack.RuleSetUseItem[];
|
|
10
10
|
export declare const getCssLoader: (unpackConfig: UnpackConfig) => {
|
|
11
11
|
loader: string;
|
|
12
|
-
options:
|
|
13
|
-
minify?: boolean;
|
|
14
|
-
errorRecovery?: boolean;
|
|
15
|
-
targets: import("node_modules/@rspack/core/dist/builtin-loader/lightningcss").Targets | string[] | string;
|
|
16
|
-
include?: Rspack.LightningcssFeatureOptions;
|
|
17
|
-
exclude?: Rspack.LightningcssFeatureOptions;
|
|
18
|
-
drafts?: import("node_modules/@rspack/core/dist/builtin-loader/lightningcss").Drafts;
|
|
19
|
-
nonStandard?: import("node_modules/@rspack/core/dist/builtin-loader/lightningcss").NonStandard;
|
|
20
|
-
pseudoClasses?: import("node_modules/@rspack/core/dist/builtin-loader/lightningcss").PseudoClasses;
|
|
21
|
-
unusedSymbols?: string[];
|
|
22
|
-
};
|
|
12
|
+
options: Rspack.LightningcssLoaderOptions | undefined;
|
|
23
13
|
} | {
|
|
24
14
|
loader: string;
|
|
25
15
|
options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/rspack-config/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/rspack-config/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAIrD,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAejF;AAED,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,IAAI,GAAG,KAAK,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,uBAAuB,cAAc,KAAG,MASzE,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,CAAC,MAAM,CAAC,cAAc,GAAG,KAAK,GAAG,SAAS,CAAC,KAC3D,MAAM,CAAC,cAAc,EAAE,CAAA;AAElD,eAAO,MAAM,YAAY,GAAI,cAAc,YAAY;;;;;;;;;;;;;;;;CAatD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,cAAc,YAAY;;;;;;;;;;;CAUvD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,cAAc,YAAY;;;CAcvD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rspack-config/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rspack-config/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAoB3D,wBAAsB,eAAe,CAAC,oBAAoB,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAmM/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeCss.d.ts","sourceRoot":"","sources":["../../src/rspack-config/nativeCss.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nativeCss.d.ts","sourceRoot":"","sources":["../../src/rspack-config/nativeCss.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAU,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAUnE,wBAAgB,oBAAoB,CAAC,EACnC,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,YAAY,CAyDf"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unpackjs/core",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.1",
|
|
4
4
|
"description": "An Rspack-based build tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@unocss/core": "66.6.
|
|
32
|
+
"@unocss/core": "66.6.3",
|
|
33
33
|
"css-loader": "7.1.4",
|
|
34
34
|
"launch-editor": "2.13.1",
|
|
35
35
|
"less-loader": "12.3.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildAnalyze.d.ts","sourceRoot":"","sources":["../../src/rspack-config/buildAnalyze.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG3D,wBAAsB,uBAAuB,CAAC,EAC5C,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,OAAO,CAAC,YAAY,CAAC,CAkBxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"detectCircular.d.ts","sourceRoot":"","sources":["../../src/rspack-config/detectCircular.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAyB3D,wBAAgB,yBAAyB,CAAC,EACxC,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,YAAY,CAwCf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeCheck.d.ts","sourceRoot":"","sources":["../../src/rspack-config/typeCheck.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAE3D,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,YAAY,CAAA;IACpB,YAAY,EAAE,YAAY,CAAA;CAC3B,GAAG,OAAO,CAAC,YAAY,CAAC,CAwCxB"}
|