@ohos-ports/rsbuild-core 2.2.9-beta.0
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/LICENSE +21 -0
- package/README.md +27 -0
- package/bin/rsbuild.js +20 -0
- package/compiled/@rstackjs/load-config/index.d.ts +87 -0
- package/compiled/@rstackjs/load-config/license +21 -0
- package/compiled/@rstackjs/load-config/package.json +1 -0
- package/compiled/chokidar/index.d.ts +385 -0
- package/compiled/chokidar/license +21 -0
- package/compiled/chokidar/package.json +1 -0
- package/compiled/connect-next/index.d.ts +57 -0
- package/compiled/connect-next/license +26 -0
- package/compiled/connect-next/package.json +1 -0
- package/compiled/cors/index.d.ts +56 -0
- package/compiled/cors/license +22 -0
- package/compiled/cors/package.json +1 -0
- package/compiled/css-loader/api.js +85 -0
- package/compiled/css-loader/getUrl.js +26 -0
- package/compiled/css-loader/index.d.ts +1 -0
- package/compiled/css-loader/index.js +2 -0
- package/compiled/css-loader/license +20 -0
- package/compiled/css-loader/noSourceMaps.js +5 -0
- package/compiled/css-loader/package.json +1 -0
- package/compiled/css-loader/sourceMaps.js +16 -0
- package/compiled/html-rspack-plugin/default_index.ejs +9 -0
- package/compiled/html-rspack-plugin/htmlLoader.js +157 -0
- package/compiled/html-rspack-plugin/index.d.ts +395 -0
- package/compiled/html-rspack-plugin/index.js +2400 -0
- package/compiled/html-rspack-plugin/license +20 -0
- package/compiled/html-rspack-plugin/package.json +1 -0
- package/compiled/http-proxy-middleware/index.d.ts +455 -0
- package/compiled/http-proxy-middleware/license +22 -0
- package/compiled/http-proxy-middleware/package.json +1 -0
- package/compiled/jiti/LICENSE +21 -0
- package/compiled/jiti/README.md +258 -0
- package/compiled/jiti/dist/babel.cjs +47446 -0
- package/compiled/jiti/dist/jiti.cjs +5990 -0
- package/compiled/jiti/lib/jiti-cli.mjs +19 -0
- package/compiled/jiti/lib/jiti-hooks.mjs +89 -0
- package/compiled/jiti/lib/jiti-native.mjs +76 -0
- package/compiled/jiti/lib/jiti-register.d.mts +1 -0
- package/compiled/jiti/lib/jiti-register.mjs +2 -0
- package/compiled/jiti/lib/jiti-static.mjs +19 -0
- package/compiled/jiti/lib/jiti.cjs +24 -0
- package/compiled/jiti/lib/jiti.d.cts +8 -0
- package/compiled/jiti/lib/jiti.d.mts +8 -0
- package/compiled/jiti/lib/jiti.mjs +23 -0
- package/compiled/jiti/lib/types.d.ts +420 -0
- package/compiled/jiti/package.json +146 -0
- package/compiled/postcss/index.js +1 -0
- package/compiled/postcss/lib/at-rule.d.ts +139 -0
- package/compiled/postcss/lib/comment.d.ts +67 -0
- package/compiled/postcss/lib/container.d.ts +474 -0
- package/compiled/postcss/lib/css-syntax-error.d.ts +247 -0
- package/compiled/postcss/lib/declaration.d.ts +150 -0
- package/compiled/postcss/lib/document.d.ts +68 -0
- package/compiled/postcss/lib/fromJSON.d.ts +9 -0
- package/compiled/postcss/lib/input.d.ts +226 -0
- package/compiled/postcss/lib/lazy-result.d.ts +189 -0
- package/compiled/postcss/lib/list.d.ts +60 -0
- package/compiled/postcss/lib/no-work-result.d.ts +45 -0
- package/compiled/postcss/lib/node.d.ts +555 -0
- package/compiled/postcss/lib/parse.d.ts +9 -0
- package/compiled/postcss/lib/postcss.d.ts +464 -0
- package/compiled/postcss/lib/previous-map.d.ts +80 -0
- package/compiled/postcss/lib/processor.d.ts +114 -0
- package/compiled/postcss/lib/result.d.ts +204 -0
- package/compiled/postcss/lib/root.d.ts +86 -0
- package/compiled/postcss/lib/rule.d.ts +126 -0
- package/compiled/postcss/lib/source-map-js.d.ts +4 -0
- package/compiled/postcss/lib/stringifier.d.ts +45 -0
- package/compiled/postcss/lib/stringify.d.ts +9 -0
- package/compiled/postcss/lib/warning.d.ts +146 -0
- package/compiled/postcss/license +20 -0
- package/compiled/postcss/package.json +1 -0
- package/compiled/postcss-loader/index.d.ts +1 -0
- package/compiled/postcss-loader/index.js +721 -0
- package/compiled/postcss-loader/license +20 -0
- package/compiled/postcss-loader/package.json +1 -0
- package/compiled/rslog/index.d.ts +98 -0
- package/compiled/rslog/license +21 -0
- package/compiled/rslog/package.json +1 -0
- package/compiled/rspack-chain/license +22 -0
- package/compiled/rspack-chain/package.json +1 -0
- package/compiled/rspack-chain/types/index.d.ts +515 -0
- package/compiled/rspack-manifest-plugin/index.d.ts +52 -0
- package/compiled/rspack-manifest-plugin/license +21 -0
- package/compiled/rspack-manifest-plugin/package.json +1 -0
- package/compiled/style-loader/index.d.ts +1 -0
- package/compiled/style-loader/index.js +370 -0
- package/compiled/style-loader/license +20 -0
- package/compiled/style-loader/package.json +1 -0
- package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
- package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
- package/compiled/style-loader/runtime/insertBySelector.js +34 -0
- package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
- package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
- package/compiled/style-loader/runtime/isOldIE.js +17 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
- package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
- package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
- package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
- package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
- package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
- package/compiled/ws/index.d.ts +445 -0
- package/compiled/ws/license +21 -0
- package/compiled/ws/package.json +1 -0
- package/dist/build.d.ts +4 -0
- package/dist/c.js +10 -0
- package/dist/chokidar.js +2 -0
- package/dist/chokidar.js.LICENSE.txt +1 -0
- package/dist/cli/commands.d.ts +31 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/init.d.ts +7 -0
- package/dist/client/f~0.js +22 -0
- package/dist/client/hmr.js +267 -0
- package/dist/client/overlay.js +214 -0
- package/dist/configChain.d.ts +84 -0
- package/dist/connect-next.js +2 -0
- package/dist/connect-next.js.LICENSE.txt +57 -0
- package/dist/constants.d.ts +67 -0
- package/dist/cors.js +188 -0
- package/dist/cors.js.LICENSE.txt +11 -0
- package/dist/createCompiler.d.ts +6 -0
- package/dist/createContext.d.ts +12 -0
- package/dist/createRsbuild.d.ts +4 -0
- package/dist/cssUrlLoader.mjs +34 -0
- package/dist/defaultConfig.d.ts +23 -0
- package/dist/freshImport.js +90 -0
- package/dist/helpers/cachedImport.d.ts +2 -0
- package/dist/helpers/compiler.d.ts +5 -0
- package/dist/helpers/css.d.ts +3 -0
- package/dist/helpers/exitHook.d.ts +3 -0
- package/dist/helpers/format.d.ts +4 -0
- package/dist/helpers/fs.d.ts +16 -0
- package/dist/helpers/html.d.ts +2 -0
- package/dist/helpers/index.d.ts +29 -0
- package/dist/helpers/overlayConfig.d.ts +4 -0
- package/dist/helpers/packageJson.d.ts +9 -0
- package/dist/helpers/path.d.ts +22 -0
- package/dist/helpers/restartManager.d.ts +15 -0
- package/dist/helpers/stats.d.ts +17 -0
- package/dist/helpers/url.d.ts +11 -0
- package/dist/helpers/vendors.d.ts +12 -0
- package/dist/helpers/version.d.ts +7 -0
- package/dist/hooks.d.ts +41 -0
- package/dist/http-proxy-middleware.js +14 -0
- package/dist/http-proxy-middleware.js.LICENSE.txt +34 -0
- package/dist/ignoreCssLoader.mjs +9 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +1 -0
- package/dist/initConfigs.d.ts +18 -0
- package/dist/initPlugins.d.ts +7 -0
- package/dist/inspectConfig.d.ts +7 -0
- package/dist/launch-editor-middleware.js +1 -0
- package/dist/loadConfig.d.ts +31 -0
- package/dist/loadEnv.d.ts +54 -0
- package/dist/loader/cssUrlLoader.d.ts +9 -0
- package/dist/loader/ignoreCssLoader.d.ts +10 -0
- package/dist/loader/transformLoader.d.ts +8 -0
- package/dist/loader/transformRawLoader.d.ts +4 -0
- package/dist/loader/workerLoader.d.ts +6 -0
- package/dist/logger.d.ts +24 -0
- package/dist/m.js +10348 -0
- package/dist/m.js.LICENSE.txt +26 -0
- package/dist/manifest-plugin.js +1 -0
- package/dist/memfs.js +1 -0
- package/dist/mergeConfig.d.ts +7 -0
- package/dist/open.js +2 -0
- package/dist/pluginHelper.d.ts +4 -0
- package/dist/pluginManager.d.ts +19 -0
- package/dist/plugins/appIcon.d.ts +2 -0
- package/dist/plugins/asset.d.ts +3 -0
- package/dist/plugins/basic.d.ts +4 -0
- package/dist/plugins/cache.d.ts +2 -0
- package/dist/plugins/cleanOutput.d.ts +2 -0
- package/dist/plugins/css.d.ts +8 -0
- package/dist/plugins/define.d.ts +2 -0
- package/dist/plugins/entry.d.ts +2 -0
- package/dist/plugins/externals.d.ts +9 -0
- package/dist/plugins/fileSize.d.ts +7 -0
- package/dist/plugins/html.d.ts +9 -0
- package/dist/plugins/inlineChunk.d.ts +6 -0
- package/dist/plugins/lazyCompilation.d.ts +2 -0
- package/dist/plugins/manifest.d.ts +2 -0
- package/dist/plugins/minimize.d.ts +10 -0
- package/dist/plugins/moduleFederation.d.ts +2 -0
- package/dist/plugins/nodeAddons.d.ts +2 -0
- package/dist/plugins/nonce.d.ts +2 -0
- package/dist/plugins/output.d.ts +2 -0
- package/dist/plugins/progress.d.ts +2 -0
- package/dist/plugins/resolve.d.ts +2 -0
- package/dist/plugins/resourceHints.d.ts +2 -0
- package/dist/plugins/rsdoctor.d.ts +2 -0
- package/dist/plugins/rspackProfile.d.ts +4 -0
- package/dist/plugins/server.d.ts +3 -0
- package/dist/plugins/sourceMap.d.ts +2 -0
- package/dist/plugins/splitChunks.d.ts +4 -0
- package/dist/plugins/sri.d.ts +2 -0
- package/dist/plugins/swc.d.ts +4 -0
- package/dist/plugins/target.d.ts +2 -0
- package/dist/plugins/wasm.d.ts +2 -0
- package/dist/plugins/worker.d.ts +2 -0
- package/dist/r.js +7 -0
- package/dist/range-parser.js +55 -0
- package/dist/range-parser.js.LICENSE.txt +6 -0
- package/dist/remapping.js +201 -0
- package/dist/restart.d.ts +15 -0
- package/dist/rslib-runtime.js +49 -0
- package/dist/rspack-plugins/RsbuildHtmlPlugin.d.ts +37 -0
- package/dist/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +36 -0
- package/dist/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +27 -0
- package/dist/rspack-plugins/resource-hints/extractChunks.d.ts +22 -0
- package/dist/rspack-plugins/resource-hints/getResourceType.d.ts +21 -0
- package/dist/rspackConfig.d.ts +8 -0
- package/dist/server/ansiHTML.d.ts +3 -0
- package/dist/server/assets-middleware/getFileFromUrl.d.ts +11 -0
- package/dist/server/assets-middleware/index.d.ts +35 -0
- package/dist/server/assets-middleware/memoryFileSystem.d.ts +2 -0
- package/dist/server/assets-middleware/middleware.d.ts +7 -0
- package/dist/server/assets-middleware/parseTokenList.d.ts +1 -0
- package/dist/server/assets-middleware/setupOutputFileSystem.d.ts +3 -0
- package/dist/server/assets-middleware/setupWriteToDisk.d.ts +15 -0
- package/dist/server/browserLogs.d.ts +8 -0
- package/dist/server/buildManager.d.ts +32 -0
- package/dist/server/cliShortcuts.d.ts +19 -0
- package/dist/server/compileState.d.ts +5 -0
- package/dist/server/devMiddlewares.d.ts +18 -0
- package/dist/server/devServer.d.ts +47 -0
- package/dist/server/environment.d.ts +8 -0
- package/dist/server/gracefulShutdown.d.ts +8 -0
- package/dist/server/gzipMiddleware.d.ts +2 -0
- package/dist/server/helper.d.ts +118 -0
- package/dist/server/historyApiFallback.d.ts +10 -0
- package/dist/server/hmrFallback.d.ts +1 -0
- package/dist/server/httpServer.d.ts +7 -0
- package/dist/server/middlewares.d.ts +31 -0
- package/dist/server/open.d.ts +12 -0
- package/dist/server/overlay.d.ts +3 -0
- package/dist/server/previewServer.d.ts +4 -0
- package/dist/server/proxy.d.ts +7 -0
- package/dist/server/publicPathnames.d.ts +2 -0
- package/dist/server/runner/asModule.d.ts +2 -0
- package/dist/server/runner/basic.d.ts +25 -0
- package/dist/server/runner/cjs.d.ts +10 -0
- package/dist/server/runner/esm.d.ts +6 -0
- package/dist/server/runner/index.d.ts +6 -0
- package/dist/server/runner/type.d.ts +42 -0
- package/dist/server/serverSetup.d.ts +2 -0
- package/dist/server/socketServer.d.ts +113 -0
- package/dist/server/watchFiles.d.ts +15 -0
- package/dist/sirv.js +122 -0
- package/dist/tinyglobby.js +1 -0
- package/dist/trace-mapping.js +548 -0
- package/dist/transformLoader.mjs +36 -0
- package/dist/transformRawLoader.mjs +4 -0
- package/dist/types/config.d.ts +1796 -0
- package/dist/types/context.d.ts +89 -0
- package/dist/types/hooks.d.ts +261 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/plugin.d.ts +479 -0
- package/dist/types/rsbuild.d.ts +241 -0
- package/dist/types/rspack.d.ts +10 -0
- package/dist/types/thirdParty.d.ts +161 -0
- package/dist/types/utils.d.ts +16 -0
- package/dist/workerLoader.mjs +94 -0
- package/dist/ws.js +2 -0
- package/package.json +107 -0
- package/static/openChrome.applescript +95 -0
- package/types.d.ts +422 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { isCSSModules } from "./c.js";
|
|
2
|
+
let pitch = function() {
|
|
3
|
+
let { modules } = this.getOptions();
|
|
4
|
+
if (!isCSSModules(modules, this)) return '';
|
|
5
|
+
};
|
|
6
|
+
export default function(source) {
|
|
7
|
+
return source.includes('___CSS_LOADER_EXPORT___') ? '' : source;
|
|
8
|
+
};
|
|
9
|
+
export { pitch };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The methods and types exported from this file are considered as
|
|
3
|
+
* the public API of @rsbuild/core.
|
|
4
|
+
*/ import type * as Rspack from '@rspack/core';
|
|
5
|
+
import { rspack } from '@rspack/core';
|
|
6
|
+
export { type RunCLIOptions, runCLI } from './cli/index.js';
|
|
7
|
+
export { createRsbuild } from './createRsbuild.js';
|
|
8
|
+
export { type ConfigParams, defineConfig, type LoadConfigOptions, type LoadConfigResult, type RsbuildConfigAsyncFn, type RsbuildConfigDefinition, type RsbuildConfigSyncFn, loadConfig } from './loadConfig.js';
|
|
9
|
+
// Core methods
|
|
10
|
+
export { type LoadEnvOptions, type LoadEnvResult, loadEnv } from './loadEnv.js';
|
|
11
|
+
// Rsbuild version
|
|
12
|
+
export declare const version: string;
|
|
13
|
+
// Rspack instance
|
|
14
|
+
export { rspack };
|
|
15
|
+
export type { Rspack };
|
|
16
|
+
export type { ChainIdentifier } from './configChain.js';
|
|
17
|
+
// Constants
|
|
18
|
+
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME } from './constants.js';
|
|
19
|
+
export { defaultAllowedOrigins } from './defaultConfig.js';
|
|
20
|
+
export { ensureAssetPrefix } from './helpers/url.js';
|
|
21
|
+
// Helpers
|
|
22
|
+
export { createLogger, type Logger, defaultLogger as logger } from './logger.js';
|
|
23
|
+
export { mergeRsbuildConfig } from './mergeConfig.js';
|
|
24
|
+
export type { HotClient, HotOnConnect, RsbuildDevServer } from './server/devServer.js';
|
|
25
|
+
export type { RsbuildServerBase, ServerStartResult, StartDevServerResult, StartPreviewServerResult } from './server/helper.js';
|
|
26
|
+
export type { RsbuildPreviewServer } from './server/previewServer.js';
|
|
27
|
+
// Types
|
|
28
|
+
export type { AliasStrategy, AppIcon, AppIconItem, AutoExternal, AutoExternalExclude, Build, BuildOptions, BuildResult, Charset, CleanDistPath, CleanDistPathObject, ClientConfig, CliShortcut, CompressOptions, ConfigChain, ConfigChainWithContext, Connect, ConsoleType, CreateCompiler, CreateRsbuildOptions, CrossOrigin, CSSLoaderOptions, CSSModules, CSSModulesLocalsConvention, DataUriLimit, Decorators, DevConfig, DistPathConfig, EnvironmentConfig, EnvironmentContext, FilenameConfig, FilenameHash, HistoryApiFallbackContext, HistoryApiFallbackOptions, HtmlBasicTag, HtmlConfig, HtmlFallback, HtmlRspackPlugin, HtmlTag, HtmlTagContext, HtmlTagDescriptor, HtmlTagHandler, InitConfigsOptions, InlineChunkConfig, InlineChunkTest, InlineChunkTestFunction, InspectConfigOptions, InspectConfigResult, InternalContext, LegalComments, LogLevel, ManifestConfig, ManifestData, ManifestObjectConfig, MergedEnvironmentConfig, MetaAttrs, MetaOptions, Minify, ModifyBundlerChainFn, ModifyBundlerChainUtils, ModifyChainUtils, ModifyEnvironmentConfigFn, ModifyEnvironmentConfigUtils, ModifyHTMLContext, ModifyHTMLFn, ModifyHTMLTagsContext, ModifyHTMLTagsFn, ModifyRsbuildConfigFn, ModifyRsbuildConfigUtils, ModifyRspackConfigFn, ModifyRspackConfigUtils, ModuleFederationConfig, NormalizedConfig, NormalizedDevConfig, NormalizedEnvironmentConfig, NormalizedHtmlConfig, NormalizedModuleFederationConfig, NormalizedOutputConfig, NormalizedPerformanceConfig, NormalizedResolveConfig, NormalizedSecurityConfig, NormalizedServerConfig, NormalizedSourceConfig, NormalizedSplitChunksConfig, NormalizedToolsConfig, OnAfterBuildFn, OnAfterCreateCompilerFn, OnAfterDevCompileFn, OnAfterEnvironmentCompileFn, OnAfterStartDevServerFn, OnAfterStartPreviewServerFn, OnBeforeBuildFn, OnBeforeCreateCompilerFn, OnBeforeDevCompileFn, OnBeforeEnvironmentCompileFn, OnBeforeStartDevServerFn, OnBeforeStartPreviewServerFn, OnCloseBuildFn, OnCloseDevServerFn, OnDevCompileDoneFn, OnExitFn, OnRestartFn, OutputConfig, OverlayOptions, OutputStructure, PerformanceConfig, PluginManager, Polyfill, PostCSSLoaderOptions, PostCSSOptions, PostCSSPlugin, PreconnectOption, PreviewOptions, PrintUrls, ProcessAssetsDescriptor, ProcessAssetsHandler, ProcessAssetsHook, ProgressBarConfig, ProxyBypass, ProxyConfig, ProxyFilter, ProxyOptions, PublicDir, PublicDirOptions, ReadonlyRoutes, RequestHandler, ResolveConfig, ResolvedCreateRsbuildOptions, ResolveHandler, ResolveHook, ResourceHintsIncludeType, RestartContext, RestartFn, RsbuildConfig, RsbuildContext, RsbuildEntry, RsbuildEntryDescription, RsbuildInstance, RsbuildMode, RsbuildPlugin, RsbuildPluginAPI, RsbuildPlugins, RsbuildTarget, RspackChain, RspackRule, ScriptInject, ScriptLoading, SecurityConfig, ServerConfig, SetupMiddlewaresContext, SetupMiddlewaresFn, SourceConfig, SourceMap, SourceMapExtract, SourceMapExtractOptions, SourceMapExtractTarget, SplitChunks, SplitChunksConfig, SplitChunksPreset, SriAlgorithm, SriOptions, StartDevServerOptions, StyleLoaderOptions, ToolsConfig, TransformContext, TransformDescriptor, TransformHandler, TransformHook, TransformImport, WatchFileEvent, WatchFiles, WebSocketUrlResolver } from './types/index.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createLogger, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, version } from "./m.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { InternalContext, NormalizedConfig, PluginManager, ResolvedCreateRsbuildOptions, Rspack } from './types/index.js';
|
|
2
|
+
export type InitConfigsOptions = {
|
|
3
|
+
context: InternalContext;
|
|
4
|
+
pluginManager: PluginManager;
|
|
5
|
+
rsbuildOptions: ResolvedCreateRsbuildOptions;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Initialize the Rsbuild config
|
|
9
|
+
* 1. Initialize the Rsbuild plugins
|
|
10
|
+
* 2. Run all the `modifyRsbuildConfig` hooks
|
|
11
|
+
* 3. Normalize the Rsbuild config, merge with the default config
|
|
12
|
+
* 4. Initialize the configs for each environment
|
|
13
|
+
* 5. Run all the `modifyEnvironmentConfig` hooks
|
|
14
|
+
* 6. Validate the final Rsbuild config
|
|
15
|
+
*/ export declare function initRsbuildConfig({ context, pluginManager }: Pick<InitConfigsOptions, 'context' | 'pluginManager'>): Promise<NormalizedConfig>;
|
|
16
|
+
export declare function initConfigs({ context, pluginManager, rsbuildOptions }: InitConfigsOptions): Promise<{
|
|
17
|
+
rspackConfigs: Rspack.Configuration[];
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Logger } from './logger.js';
|
|
2
|
+
import type { InternalContext, NormalizedEnvironmentConfig, PluginManager, RsbuildPluginAPI } from './types/index.js';
|
|
3
|
+
export declare function getHTMLPathByEntry(entryName: string, config: NormalizedEnvironmentConfig, logger: Logger): string;
|
|
4
|
+
export declare function initPluginAPI({ context, pluginManager }: {
|
|
5
|
+
context: InternalContext;
|
|
6
|
+
pluginManager: PluginManager;
|
|
7
|
+
}): (environment?: string) => RsbuildPluginAPI;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InitConfigsOptions } from './initConfigs.js';
|
|
2
|
+
import type { InspectConfigOptions, InspectConfigResult, Rspack } from './types/index.js';
|
|
3
|
+
export declare function stringifyConfig(config: unknown, verbose?: boolean): string;
|
|
4
|
+
export declare function inspectConfig({ context, pluginManager, bundlerConfigs, inspectOptions }: InitConfigsOptions & {
|
|
5
|
+
inspectOptions?: InspectConfigOptions;
|
|
6
|
+
bundlerConfigs: Rspack.Configuration[];
|
|
7
|
+
}): Promise<InspectConfigResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{rspackRequire as e,moduleFactories as t}from"./rslib-runtime.js";import{createRequire as n}from"node:module";let o=n(import.meta.url);t.add({"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor-middleware/2.14.1/6d555a60526ad6844dc2673e73b564ffd44ca896ac31b809c7cc243f8e135c00/node_modules/launch-editor-middleware/index.js"(t){let n=o("path"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/index.js");t.exports=(e,t,o)=>("function"==typeof e&&(o=e,e=void 0),"function"==typeof t&&(o=t,t=void 0),t=t||process.cwd(),function(s,a){let r;try{let e=s.url.startsWith("http")?s.url:`http://localhost${s.url}`;r=new URL(e)}catch(e){a.statusCode=500,a.end("launch-editor-middleware: invalid URL.");return}let c=r.searchParams.get("file");c?(i(c.startsWith("file://")?c:n.resolve(t,c),e,o),a.end()):(a.statusCode=500,a.end('launch-editor-middleware: required query param "file" is missing.'))})},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/linux.js"(e){e.exports={atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",code:"code",vscodium:"vscodium",codium:"codium",cursor:"cursor",trae:"trae",antigravity:"antigravity",emacs:"emacs",gvim:"gvim",idea:"idea","idea.sh":"idea",phpstorm:"phpstorm","phpstorm.sh":"phpstorm",pycharm:"pycharm","pycharm.sh":"pycharm",rubymine:"rubymine","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim",webstorm:"webstorm","webstorm.sh":"webstorm",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider",zed:"zed"}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/macos.js"(e){e.exports={"/Applications/Atom.app/Contents/MacOS/Atom":"atom","/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta","/Applications/Brackets.app/Contents/MacOS/Brackets":"brackets","/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text.app/Contents/MacOS/sublime_text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/Applications/Visual Studio Code.app/Contents/MacOS/Code":"code","/Applications/Visual Studio Code.app/Contents/MacOS/Electron":"code","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders":"code-insiders","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"code-insiders","/Applications/VSCodium.app/Contents/MacOS/Electron":"codium","/Applications/Cursor.app/Contents/MacOS/Cursor":"cursor","/Applications/Trae.app/Contents/MacOS/Electron":"trae","/Applications/Antigravity.app/Contents/MacOS/Electron":"antigravity","/Applications/AppCode.app/Contents/MacOS/appcode":"/Applications/AppCode.app/Contents/MacOS/appcode","/Applications/CLion.app/Contents/MacOS/clion":"/Applications/CLion.app/Contents/MacOS/clion","/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea","/Applications/PhpStorm.app/Contents/MacOS/phpstorm":"/Applications/PhpStorm.app/Contents/MacOS/phpstorm","/Applications/PyCharm.app/Contents/MacOS/pycharm":"/Applications/PyCharm.app/Contents/MacOS/pycharm","/Applications/PyCharm CE.app/Contents/MacOS/pycharm":"/Applications/PyCharm CE.app/Contents/MacOS/pycharm","/Applications/RubyMine.app/Contents/MacOS/rubymine":"/Applications/RubyMine.app/Contents/MacOS/rubymine","/Applications/WebStorm.app/Contents/MacOS/webstorm":"/Applications/WebStorm.app/Contents/MacOS/webstorm","/Applications/MacVim.app/Contents/MacOS/MacVim":"mvim","/Applications/GoLand.app/Contents/MacOS/goland":"/Applications/GoLand.app/Contents/MacOS/goland","/Applications/Rider.app/Contents/MacOS/rider":"/Applications/Rider.app/Contents/MacOS/rider","/Applications/Zed.app/Contents/MacOS/zed":"zed"}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/windows.js"(e){e.exports=["Brackets.exe","Code.exe","Code - Insiders.exe","VSCodium.exe","Cursor.exe","atom.exe","sublime_text.exe","notepad++.exe","clion.exe","clion64.exe","idea.exe","idea64.exe","phpstorm.exe","phpstorm64.exe","pycharm.exe","pycharm64.exe","rubymine.exe","rubymine64.exe","webstorm.exe","webstorm64.exe","goland.exe","goland64.exe","rider.exe","rider64.exe","Trae.exe","zed.exe","Antigravity.exe"]},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/get-args.js"(e){let t=o("path");e.exports=function(e,n,o,i=1){switch(t.basename(e).replace(/\.(exe|cmd|bat)$/i,"")){case"atom":case"Atom":case"Atom Beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return[`${n}:${o}:${i}`];case"notepad++":return["-n"+o,"-c"+i,n];case"vim":case"mvim":return[`+call cursor(${o}, ${i})`,n];case"joe":case"gvim":return[`+${o}`,n];case"emacs":case"emacsclient":return[`+${o}:${i}`,n];case"rmate":case"mate":case"mine":return["--line",o,n];case"code":case"Code":case"code-insiders":case"Code - Insiders":case"codium":case"trae":case"antigravity":case"cursor":case"vscodium":case"VSCodium":return["-r","-g",`${n}:${o}:${i}`];case"appcode":case"clion":case"clion64":case"idea":case"idea64":case"phpstorm":case"phpstorm64":case"pycharm":case"pycharm64":case"rubymine":case"rubymine64":case"webstorm":case"webstorm64":case"goland":case"goland64":case"rider":case"rider64":return["--line",o,"--column",i,n]}return process.env.LAUNCH_EDITOR?[n,o,i]:[n]}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/guess.js"(t){let n=o("path"),i=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/index.js"),s=o("child_process"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/macos.js"),r=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/linux.js"),c=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/editor-info/windows.js");function p(e){let t=Object.keys(a),n=e.split("\n");for(let o=0;o<t.length;o++){let i=t[o];if(n.includes(i))return a[i];let s=i.replace("/Applications","");if(-1!==e.indexOf(s)){if(i!==a[i])return a[i];let e=n.find(e=>e.endsWith(s));if(void 0!==e)return e}}}function l(e){let t=e.split("\r\n");for(let e=0;e<t.length;e++){let o=t[e].trim(),i=n.win32.basename(o);if(-1!==c.indexOf(i))return o}}function d(e){let t=Object.keys(r);for(let n=0;n<t.length;n++){let o=t[n];if(-1!==e.indexOf(o))return r[o]}}t.exports=function(e){if(e)return i.parse(e);if(process.env.LAUNCH_EDITOR)return[process.env.LAUNCH_EDITOR];if(process.versions.webcontainer)return[process.env.EDITOR||"code"];try{if("darwin"===process.platform){let e=s.execSync("ps x -o comm=",{stdio:["pipe","pipe","ignore"]}).toString(),t=p(e);if(void 0!==t)return[t]}else if("win32"===process.platform){let e=s.execSync('powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',{stdio:["pipe","pipe","ignore"]}).toString(),t=l(e);if(void 0!==t)return[t]}else if("linux"===process.platform){let e=s.execSync("ps x --no-heading -o comm --sort=comm",{stdio:["pipe","pipe","ignore"]}).toString(),t=d(e);if(void 0!==t)return[t]}}catch(e){}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]},t.exports.getEditorFromMacProcesses=p,t.exports.getEditorFromWindowsProcesses=l,t.exports.getEditorFromLinuxProcesses=d},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/index.js"(t){let n=o("fs"),i=o("os"),s=o("path"),a=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/picocolors/1.1.1/a2cca8821324d9b53ce284317d33c07b8ca7ab5b808164538a24d91cf6e92abb/node_modules/picocolors/picocolors.js"),r=o("child_process"),c=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/guess.js"),p=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor/2.14.1/c96a0c360b9d924c696715e2b6fb6410e2c6cd17c1dfa54e287a007414e10225/node_modules/launch-editor/get-args.js"),l=/:(\d+)(:(\d+))?$/,d=null;t.exports=function(e,t,m){var u,b;let h,f,x=((u=e).startsWith("file://")&&(u=o("url").fileURLToPath(u)),h=u.replace(l,""),{fileName:h,lineNumber:(f=u.match(l))&&f[1],columnNumber:f&&f[3]}),{fileName:g}=x,{lineNumber:v,columnNumber:C}=x;if("win32"===process.platform&&s.resolve(g).startsWith("\\\\"))return m(g,"UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");if(!n.existsSync(g))return;"function"==typeof t&&(m=t,t=void 0),b=m,m=(e,t)=>{console.log(),console.log(a.red("Could not open "+s.basename(e)+" in the editor.")),t&&("."!==t[t.length-1]&&(t+="."),console.log(a.red("The editor process exited with an error: "+t))),console.log(),b&&b(e,t)};let[S,...A]=c(t);if(!S)return void m(g,null);if("linux"===process.platform&&g.startsWith("/mnt/")&&/Microsoft/i.test(i.release())&&(g=s.relative("",g)),v){let e=p(S,g,v,C);A.push.apply(A,e)}else A.push(g);if(d&&function(e){switch(e){case"vim":case"emacs":case"nano":return!0}return!1}(S)&&d.kill("SIGKILL"),"win32"===process.platform){let e=[S,...A.map(function(e){return e.replace(/([&|<>,;=^])/g,"^$1")})].map(function(e){return e.includes("^")?`^"${e}^"`:e.includes(" ")?`"${e}"`:e}).join(" ");d=r.exec(e,{stdio:"inherit",shell:!0})}else d=r.spawn(S,A,{stdio:"inherit"});d.on("exit",function(e){d=null,e&&m(g,"(code "+e+")")}),d.on("error",function(e){let{code:t,message:n}=e;"ENOENT"===t&&(n=`${n} ('${S}' command does not exist in 'PATH')`),m(g,n)})}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/picocolors/1.1.1/a2cca8821324d9b53ce284317d33c07b8ca7ab5b808164538a24d91cf6e92abb/node_modules/picocolors/picocolors.js"(e){let t=process||{},n=t.argv||[],o=t.env||{},i=!(o.NO_COLOR||n.includes("--no-color"))&&(!!o.FORCE_COLOR||n.includes("--color")||"win32"===t.platform||(t.stdout||{}).isTTY&&"dumb"!==o.TERM||!!o.CI),s=(e,t,n=e)=>o=>{let i=""+o,s=i.indexOf(t,e.length);return~s?e+a(i,t,n,s)+t:e+i+t},a=(e,t,n,o)=>{let i="",s=0;do i+=e.substring(s,o)+n,s=o+t.length,o=e.indexOf(t,s);while(~o);return i+e.substring(s)},r=(e=i)=>{let t=e?s:()=>String;return{isColorSupported:e,reset:t("\x1b[0m","\x1b[0m"),bold:t("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),dim:t("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),italic:t("\x1b[3m","\x1b[23m"),underline:t("\x1b[4m","\x1b[24m"),inverse:t("\x1b[7m","\x1b[27m"),hidden:t("\x1b[8m","\x1b[28m"),strikethrough:t("\x1b[9m","\x1b[29m"),black:t("\x1b[30m","\x1b[39m"),red:t("\x1b[31m","\x1b[39m"),green:t("\x1b[32m","\x1b[39m"),yellow:t("\x1b[33m","\x1b[39m"),blue:t("\x1b[34m","\x1b[39m"),magenta:t("\x1b[35m","\x1b[39m"),cyan:t("\x1b[36m","\x1b[39m"),white:t("\x1b[37m","\x1b[39m"),gray:t("\x1b[90m","\x1b[39m"),bgBlack:t("\x1b[40m","\x1b[49m"),bgRed:t("\x1b[41m","\x1b[49m"),bgGreen:t("\x1b[42m","\x1b[49m"),bgYellow:t("\x1b[43m","\x1b[49m"),bgBlue:t("\x1b[44m","\x1b[49m"),bgMagenta:t("\x1b[45m","\x1b[49m"),bgCyan:t("\x1b[46m","\x1b[49m"),bgWhite:t("\x1b[47m","\x1b[49m"),blackBright:t("\x1b[90m","\x1b[39m"),redBright:t("\x1b[91m","\x1b[39m"),greenBright:t("\x1b[92m","\x1b[39m"),yellowBright:t("\x1b[93m","\x1b[39m"),blueBright:t("\x1b[94m","\x1b[39m"),magentaBright:t("\x1b[95m","\x1b[39m"),cyanBright:t("\x1b[96m","\x1b[39m"),whiteBright:t("\x1b[97m","\x1b[39m"),bgBlackBright:t("\x1b[100m","\x1b[49m"),bgRedBright:t("\x1b[101m","\x1b[49m"),bgGreenBright:t("\x1b[102m","\x1b[49m"),bgYellowBright:t("\x1b[103m","\x1b[49m"),bgBlueBright:t("\x1b[104m","\x1b[49m"),bgMagentaBright:t("\x1b[105m","\x1b[49m"),bgCyanBright:t("\x1b[106m","\x1b[49m"),bgWhiteBright:t("\x1b[107m","\x1b[49m")}};e.exports=r(),e.exports.createColors=r},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/index.js"(t,n){e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/quote.js"),n.parse=e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/parse.js")},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/parse.js"(e){for(var t="(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])",n=RegExp("^"+t+"$"),o="|&;()<> \\t",i=/^#$/,s="",a=0;a<4;a++)s+=(0x100000000*Math.random()).toString(16);var r=RegExp("^"+s);e.exports=function(e,a,c){var p=function(e,a,r){r||(r={});var c=r.escape||"\\",p=!0===r.splitUnquoted?" \n":"string"==typeof r.splitUnquoted?r.splitUnquoted:"",l=function(e,t){for(var n,o=t.lastIndex,i=[];n=t.exec(e);)i[i.length]=n,t.lastIndex===n.index&&(t.lastIndex+=1);return t.lastIndex=o,i}(e,RegExp(["("+t+")","("+("(\\"+c+"['\""+o+"]|[^\\s'\""+o)+'])+|"((\\\\"|[^"])*?)"|\'([^\']*?)\')+'].join("|"),"g"));if(0===l.length)return[];a||(a={});var d=!1;return l.map(function(t){var o,r=t[0];if(r&&!d){if(n.test(r))return{op:r};var l=!1,m=!1,u="",b=[],h=!1,f=null,x=!1;for(o=0;o<r.length;o++){var g=r.charAt(o);if(p&&"$"!==g&&_(),x=x||!l&&("*"===g||"?"===g),m)u+=g,m=!1;else if(l)g===l?l=!1:"'"==l?u+=g:g===c?(o+=1,'"'===(g=r.charAt(o))||g===c||"$"===g?u+=g:u+=c+g):"$"===g?u+=O():u+=g;else if('"'===g||"'"===g)l=g,h=!0;else if(n.test(g))return{op:r};else if(i.test(g)){d=!0;var v={comment:e.slice(t.index+o+1)};if(u.length)return[u,v];return[v]}else if(g===c)m=!0;else if("$"===g){var C=O();if(p)for(var S=0;S<C.length;S+=1){var A=C.charAt(S);0>p.indexOf(A)?(_(),u+=A):null===f?f=+(" "!==A&&" "!==A&&"\n"!==A):" "!==A&&" "!==A&&"\n"!==A&&(f+=1)}else u+=C}else u+=g}if(x)return{op:"glob",pattern:u};if(p){if(null!==f&&f>0){b[b.length]=u,u="";for(var y=1;y<f;y+=1)b[b.length]=""}return(""!==u||h&&0===b.length)&&(b[b.length]=u),b}return u}function O(){o+=1;var e,t,n,i,c,p=r.charAt(o);if("{"===p){if(o+=1,"}"===r.charAt(o))throw Error("Bad substitution: "+r.slice(o-2,o+1));var l=1;for(i=o;l>0&&i<r.length;)"{"===r.charAt(i)&&"$"===r.charAt(i-1)?l+=1:"}"===r.charAt(i)&&(l-=1),i+=1;if(0!==l)throw Error("Bad substitution: "+r.slice(o));i-=1,c=r.slice(o,i),o=i}else if(/[*@#?$!_-]/.test(p))c=p,o+=1;else{var d=r.slice(o);(i=d.match(/[^\w\d_]/))?(c=d.slice(0,i.index),o+=i.index-1):(c=d,o=r.length)}return e=a,t=c,(void 0===(n="function"==typeof e?e(t):e[t])&&""!=t?n="":void 0===n&&(n="$"),"object"==typeof n)?""+s+JSON.stringify(n)+s:""+n}function _(){if(null!==f){if(0===f)""!==u&&(b[b.length]=u,u="");else{b[b.length]=u,u="";for(var e=1;e<f;e+=1)b[b.length]=""}f=null}}}).reduce(function(e,t){return void 0===t||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}(e,a,c);return"function"!=typeof a?p:p.reduce(function(e,t){if("object"==typeof t)return e[e.length]=t,e;var n=t.split(RegExp("("+s+".*?"+s+")","g"));return 1===n.length?e[e.length]=n[0]:n.filter(Boolean).forEach(function(t){e[e.length]=r.test(t)?JSON.parse(t.split(s)[1]):t}),e},[])}},"../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/shell-quote/1.10.0/cb94c86a55bacd5a83a2402c1207419c1936bf178e159a0b8804af88f1935bba/node_modules/shell-quote/quote.js"(e){var t=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],n=/[\n\r\u2028\u2029]/,o=/[\s#!"$&'():;<=>@\\^`|]/g;e.exports=function(e){return e.map(function(e){if(""===e)return"''";if(e&&"object"==typeof e){if("op"in e&&"glob"===e.op){if("string"!=typeof e.pattern)throw TypeError("glob token requires a string `pattern`");if(n.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(o,"\\$&")}if("op"in e&&"string"==typeof e.op){if(0>t.indexOf(e.op))throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,"\\$&")}if("comment"in e&&"string"==typeof e.comment){if(n.test(e.comment))throw TypeError("`comment` must not contain line terminators");return"#"+e.comment}throw TypeError("unrecognized object token shape")}return/["\s\\]/.test(e)&&!/'/.test(e)?"'"+e.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(e)?'"'+e.replace(/(["\\$`!])/g,"\\$1")+'"':String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}}}),e("../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/launch-editor-middleware/2.14.1/6d555a60526ad6844dc2673e73b564ffd44ca896ac31b809c7cc243f8e135c00/node_modules/launch-editor-middleware/index.js");
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type LoadConfigOptions as BaseOptions, type LoadConfigResult as BaseResult } from '../compiled/@rstackjs/load-config/index.js';
|
|
2
|
+
import type { RsbuildConfig } from './types/index.js';
|
|
3
|
+
export type { ConfigLoader } from '../compiled/@rstackjs/load-config/index.js';
|
|
4
|
+
export type ConfigParams = {
|
|
5
|
+
env: string;
|
|
6
|
+
command: string;
|
|
7
|
+
envMode?: string;
|
|
8
|
+
meta?: Record<string, unknown>;
|
|
9
|
+
};
|
|
10
|
+
export type RsbuildConfigAsyncFn = (env: ConfigParams) => Promise<RsbuildConfig>;
|
|
11
|
+
export type RsbuildConfigSyncFn = (env: ConfigParams) => RsbuildConfig;
|
|
12
|
+
export type RsbuildConfigDefinition = RsbuildConfig | RsbuildConfigSyncFn | RsbuildConfigAsyncFn;
|
|
13
|
+
export type LoadConfigOptions = Pick<BaseOptions<[ConfigParams]>, 'cwd' | 'path' | 'loader' | 'exportName' | 'configFileNames'> & {
|
|
14
|
+
/**
|
|
15
|
+
* A custom meta object to be passed into the config function of `defineConfig`.
|
|
16
|
+
*/ meta?: Record<string, unknown>;
|
|
17
|
+
/**
|
|
18
|
+
* The `envMode` passed into the config function of `defineConfig`.
|
|
19
|
+
* @default process.env.NODE_ENV
|
|
20
|
+
*/ envMode?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The command passed to the config function.
|
|
23
|
+
* @default process.argv[2]
|
|
24
|
+
*/ command?: string;
|
|
25
|
+
};
|
|
26
|
+
export type LoadConfigResult<Config = RsbuildConfig> = Pick<BaseResult<Config>, 'content' | 'filePath' | 'dependencies'>;
|
|
27
|
+
/**
|
|
28
|
+
* This function helps you to autocomplete configuration types.
|
|
29
|
+
* It accepts a Rsbuild config object, or a function that returns a config.
|
|
30
|
+
*/ export declare function defineConfig<const Config extends RsbuildConfig, const Definition extends Config | ((env: ConfigParams) => Config) | ((env: ConfigParams) => Promise<Config>)>(config: Definition): Definition extends (env: ConfigParams) => Promise<unknown> ? RsbuildConfigAsyncFn : Definition extends (env: ConfigParams) => unknown ? RsbuildConfigSyncFn : RsbuildConfig;
|
|
31
|
+
export declare function loadConfig<Config = RsbuildConfig>({ cwd, path, configFileNames, envMode, meta, loader, command, exportName }?: LoadConfigOptions): Promise<LoadConfigResult<Config>>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type LoadEnvOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* The root path to load the env file
|
|
4
|
+
* @default process.cwd()
|
|
5
|
+
*/ cwd?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Used to specify the name of the .env.[mode] file
|
|
8
|
+
* @default process.env.NODE_ENV
|
|
9
|
+
*/ mode?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The prefix of public variables
|
|
12
|
+
* @default ['PUBLIC_']
|
|
13
|
+
*/ prefixes?: string[];
|
|
14
|
+
/**
|
|
15
|
+
* Specify a target object to store environment variables.
|
|
16
|
+
* If not provided, variables will be written to `process.env`.
|
|
17
|
+
* @default process.env
|
|
18
|
+
*/ processEnv?: Record<string, string>;
|
|
19
|
+
};
|
|
20
|
+
export type LoadEnvResult = {
|
|
21
|
+
/**
|
|
22
|
+
* All environment variables in the .env file
|
|
23
|
+
*/ parsed: Record<string, string>;
|
|
24
|
+
/**
|
|
25
|
+
* The absolute paths to all env files
|
|
26
|
+
*/ filePaths: string[];
|
|
27
|
+
/**
|
|
28
|
+
* Environment variables that start with prefixes.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* {
|
|
33
|
+
* PUBLIC_FOO: 'bar',
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
**/ rawPublicVars: Record<string, string | undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* Formatted environment variables that start with prefixes.
|
|
39
|
+
* The keys contain the prefixes `process.env.*` and `import.meta.env.*`.
|
|
40
|
+
* The values are processed by `JSON.stringify`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* {
|
|
45
|
+
* 'process.env.PUBLIC_FOO': '"bar"',
|
|
46
|
+
* 'import.meta.env.PUBLIC_FOO': '"bar"',
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
49
|
+
**/ publicVars: Record<string, string>;
|
|
50
|
+
/**
|
|
51
|
+
* Clear the environment variables mounted on `process.env`
|
|
52
|
+
*/ cleanup: () => void;
|
|
53
|
+
};
|
|
54
|
+
export declare function loadEnv({ cwd, mode, prefixes, processEnv }?: LoadEnvOptions): LoadEnvResult;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AssetInfo, LoaderDefinitionFunction, PathData, PitchLoaderDefinitionFunction } from '@rspack/core';
|
|
2
|
+
import type { CSSLoaderOptions } from '../types/index.js';
|
|
3
|
+
type CSSUrlLoaderOptions = {
|
|
4
|
+
filename: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
|
|
5
|
+
modules: CSSLoaderOptions['modules'];
|
|
6
|
+
};
|
|
7
|
+
declare const cssUrlLoader: LoaderDefinitionFunction<CSSUrlLoaderOptions>;
|
|
8
|
+
export declare const pitch: PitchLoaderDefinitionFunction<CSSUrlLoaderOptions>;
|
|
9
|
+
export default cssUrlLoader;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LoaderDefinition, PitchLoaderDefinitionFunction } from '@rspack/core';
|
|
2
|
+
import type { CSSLoaderOptions } from '../types/index.js';
|
|
3
|
+
type IgnoreCssLoaderOptions = {
|
|
4
|
+
modules?: CSSLoaderOptions['modules'];
|
|
5
|
+
};
|
|
6
|
+
declare const ignoreCssLoader: LoaderDefinition<IgnoreCssLoaderOptions>;
|
|
7
|
+
// In non-emitting builds, skip css-loader and following CSS transforms for global CSS.
|
|
8
|
+
// CSS Modules must still pass through css-loader so SSR builds can export locals.
|
|
9
|
+
export declare const pitch: PitchLoaderDefinitionFunction<IgnoreCssLoaderOptions>;
|
|
10
|
+
export default ignoreCssLoader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LoaderDefinition } from '@rspack/core';
|
|
2
|
+
import type { EnvironmentContext } from '../types/index.js';
|
|
3
|
+
export type TransformLoaderOptions = {
|
|
4
|
+
id: string;
|
|
5
|
+
getEnvironment: () => EnvironmentContext;
|
|
6
|
+
};
|
|
7
|
+
declare const transformLoader: LoaderDefinition<TransformLoaderOptions>;
|
|
8
|
+
export default transformLoader;
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The default logger exported from this module is mainly for CLI/bootstrap
|
|
3
|
+
* scenarios and backwards compatibility. When writing core runtime code,
|
|
4
|
+
* prefer `context.logger` or `api.logger` so logs stay scoped to the current
|
|
5
|
+
* Rsbuild instance.
|
|
6
|
+
*
|
|
7
|
+
* Logging message case convention:
|
|
8
|
+
*
|
|
9
|
+
* Info, ready, success and debug messages:
|
|
10
|
+
* - Start with lowercase
|
|
11
|
+
* - Example: "info build started..."
|
|
12
|
+
*
|
|
13
|
+
* Errors and warnings:
|
|
14
|
+
* - Start with uppercase
|
|
15
|
+
* - Example: "error Failed to build"
|
|
16
|
+
*
|
|
17
|
+
* This convention helps distinguish between normal operations
|
|
18
|
+
* and important alerts that require attention.
|
|
19
|
+
*/ import { createLogger as baseCreateLogger, type Logger, logger as defaultLogger } from '../compiled/rslog/index.js';
|
|
20
|
+
export declare const isDebug: () => boolean;
|
|
21
|
+
export declare const isVerbose: (targetLogger: Pick<Logger, 'level'>) => boolean;
|
|
22
|
+
export declare const createLogger: (...args: Parameters<typeof baseCreateLogger>) => ReturnType<typeof baseCreateLogger>;
|
|
23
|
+
export { defaultLogger };
|
|
24
|
+
export type { Logger };
|