rolldown 0.14.0-snapshot-db4090b-20241123003628 → 0.14.0-snapshot-87f7277-20241125003644
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/cjs/cli.cjs +3 -3
- package/dist/cjs/experimental-index.cjs +34 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/parallel-plugin-worker.cjs +2 -2
- package/dist/esm/cli.mjs +3 -3
- package/dist/esm/experimental-index.mjs +34 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/parallel-plugin-worker.mjs +2 -2
- package/dist/shared/rolldown-binding.wasi.cjs +39 -36
- package/dist/shared/{src_index-wJBYWP9G.mjs → src_index-AKIcG6mr.mjs} +229 -278
- package/dist/shared/{src_index-WgTHG2Z9.cjs → src_index-AzJK-lP0.cjs} +230 -280
- package/dist/types/binding.d.ts +23 -18
- package/dist/types/builtin-plugin/alias-plugin.d.ts +10 -0
- package/dist/types/builtin-plugin/constructors.d.ts +16 -0
- package/dist/types/builtin-plugin/replace-plugin.d.ts +28 -0
- package/dist/types/{options/normalized-ecma-transform-plugin-config.d.ts → builtin-plugin/transform-plugin.d.ts} +2 -1
- package/dist/types/builtin-plugin/utils.d.ts +12 -0
- package/dist/types/cli/arguments/normalize.d.ts +2 -2
- package/dist/types/experimental-index.d.ts +5 -1
- package/dist/types/index.d.ts +4 -4
- package/dist/types/log/logger.d.ts +2 -16
- package/dist/types/options/input-options-schema.d.ts +588 -0
- package/dist/types/options/input-options.d.ts +99 -586
- package/dist/types/options/normalized-input-options.d.ts +8 -2
- package/dist/types/options/normalized-output-options.d.ts +12 -3
- package/dist/types/options/output-options-schema.d.ts +146 -0
- package/dist/types/options/output-options.d.ts +70 -142
- package/dist/types/options/watch-options.d.ts +5 -0
- package/dist/types/plugin/bindingify-build-hooks.d.ts +9 -10
- package/dist/types/plugin/bindingify-output-hooks.d.ts +12 -15
- package/dist/types/plugin/bindingify-plugin.d.ts +12 -3
- package/dist/types/plugin/bindingify-watch-hooks.d.ts +3 -5
- package/dist/types/plugin/index.d.ts +2 -2
- package/dist/types/plugin/minimal-plugin-context.d.ts +15 -0
- package/dist/types/plugin/plugin-context.d.ts +3 -3
- package/dist/types/plugin/transform-plugin-context.d.ts +2 -3
- package/dist/types/rolldown-build.d.ts +2 -2
- package/dist/types/rolldown.d.ts +2 -2
- package/dist/types/types/rolldown-options.d.ts +2 -2
- package/dist/types/utils/bindingify-input-options.d.ts +5 -0
- package/dist/types/utils/bindingify-output-options.d.ts +3 -0
- package/dist/types/utils/create-bundler.d.ts +2 -2
- package/dist/types/utils/normalize-plugin-option.d.ts +1 -1
- package/package.json +15 -15
- package/dist/types/options/bindingify-input-options.d.ts +0 -5
- package/dist/types/options/bindingify-output-options.d.ts +0 -3
- package/dist/types/options/normalized-alias-plugin-config.d.ts +0 -8
- package/dist/types/options/watch-option.d.ts +0 -5
- package/dist/types/plugin/builtin-plugin.d.ts +0 -94
- package/dist/types/types/input-options.d.ts +0 -101
- package/dist/types/types/output-options.d.ts +0 -74
package/dist/types/binding.d.ts
CHANGED
|
@@ -36,6 +36,13 @@ export declare class BindingModuleInfo {
|
|
|
36
36
|
get code(): string | null
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
export declare class BindingNormalizedOptions {
|
|
40
|
+
get shimMissingExports(): boolean
|
|
41
|
+
get input(): Array<string> | Record<string, string>
|
|
42
|
+
get entryFilenames(): string | null
|
|
43
|
+
get format(): 'es' | 'cjs' | 'app' | 'iife' | 'umd'
|
|
44
|
+
}
|
|
45
|
+
|
|
39
46
|
export declare class BindingOutputAsset {
|
|
40
47
|
get fileName(): string
|
|
41
48
|
get originalFileName(): string | null
|
|
@@ -167,21 +174,19 @@ export interface BindingBuiltinPlugin {
|
|
|
167
174
|
options?: unknown
|
|
168
175
|
}
|
|
169
176
|
|
|
170
|
-
export
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
ViteResolvePlugin = 12
|
|
184
|
-
}
|
|
177
|
+
export type BindingBuiltinPluginName = 'builtin:wasm-helper'|
|
|
178
|
+
'builtin:import-glob'|
|
|
179
|
+
'builtin:dynamic-import-vars'|
|
|
180
|
+
'builtin:module-preload-polyfill'|
|
|
181
|
+
'builtin:manifest'|
|
|
182
|
+
'builtin:load-fallback'|
|
|
183
|
+
'builtin:transform'|
|
|
184
|
+
'builtin:wasm-fallback'|
|
|
185
|
+
'builtin:alias'|
|
|
186
|
+
'builtin:json'|
|
|
187
|
+
'builtin:build-import-analysis'|
|
|
188
|
+
'builtin:replace'|
|
|
189
|
+
'builtin:vite-resolve';
|
|
185
190
|
|
|
186
191
|
export interface BindingEmittedAsset {
|
|
187
192
|
name?: string
|
|
@@ -399,7 +404,7 @@ export interface BindingPluginHookMeta {
|
|
|
399
404
|
|
|
400
405
|
export interface BindingPluginOptions {
|
|
401
406
|
name: string
|
|
402
|
-
buildStart?: (ctx: BindingPluginContext) => MaybePromise<VoidNullable>
|
|
407
|
+
buildStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable>
|
|
403
408
|
buildStartMeta?: BindingPluginHookMeta
|
|
404
409
|
resolveId?: (ctx: BindingPluginContext, specifier: string, importer: Nullable<string>, options: BindingHookResolveIdExtraArgs) => MaybePromise<VoidNullable<BindingHookResolveIdOutput>>
|
|
405
410
|
resolveIdMeta?: BindingPluginHookMeta
|
|
@@ -420,11 +425,11 @@ export interface BindingPluginOptions {
|
|
|
420
425
|
renderChunkMeta?: BindingPluginHookMeta
|
|
421
426
|
augmentChunkHash?: (ctx: BindingPluginContext, chunk: RenderedChunk) => MaybePromise<void | string>
|
|
422
427
|
augmentChunkHashMeta?: BindingPluginHookMeta
|
|
423
|
-
renderStart?: (ctx: BindingPluginContext) => void
|
|
428
|
+
renderStart?: (ctx: BindingPluginContext, opts: BindingNormalizedOptions) => void
|
|
424
429
|
renderStartMeta?: BindingPluginHookMeta
|
|
425
430
|
renderError?: (ctx: BindingPluginContext, error: string) => void
|
|
426
431
|
renderErrorMeta?: BindingPluginHookMeta
|
|
427
|
-
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean) => MaybePromise<VoidNullable<JsChangedOutputs>>
|
|
432
|
+
generateBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs, isWrite: boolean, opts: BindingNormalizedOptions) => MaybePromise<VoidNullable<JsChangedOutputs>>
|
|
428
433
|
generateBundleMeta?: BindingPluginHookMeta
|
|
429
434
|
writeBundle?: (ctx: BindingPluginContext, bundle: BindingOutputs) => MaybePromise<VoidNullable<JsChangedOutputs>>
|
|
430
435
|
writeBundleMeta?: BindingPluginHookMeta
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BuiltinPlugin } from './constructors';
|
|
2
|
+
type AliasPluginAlias = {
|
|
3
|
+
find: string | RegExp;
|
|
4
|
+
replacement: string;
|
|
5
|
+
};
|
|
6
|
+
type AliasPluginConfig = {
|
|
7
|
+
entries: AliasPluginAlias[];
|
|
8
|
+
};
|
|
9
|
+
export declare function aliasPlugin(config: AliasPluginConfig): BuiltinPlugin;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type BindingBuiltinPluginName, BindingGlobImportPluginConfig, BindingManifestPluginConfig, BindingModulePreloadPolyfillPluginConfig, BindingJsonPluginConfig, BindingBuildImportAnalysisPluginConfig, type BindingViteResolvePluginConfig } from '../binding';
|
|
2
|
+
export declare class BuiltinPlugin {
|
|
3
|
+
name: BindingBuiltinPluginName;
|
|
4
|
+
options?: unknown;
|
|
5
|
+
constructor(name: BindingBuiltinPluginName, options?: unknown);
|
|
6
|
+
}
|
|
7
|
+
export declare function modulePreloadPolyfillPlugin(config?: BindingModulePreloadPolyfillPluginConfig): BuiltinPlugin;
|
|
8
|
+
export declare function dynamicImportVarsPlugin(): BuiltinPlugin;
|
|
9
|
+
export declare function importGlobPlugin(config?: BindingGlobImportPluginConfig): BuiltinPlugin;
|
|
10
|
+
export declare function manifestPlugin(config?: BindingManifestPluginConfig): BuiltinPlugin;
|
|
11
|
+
export declare function wasmHelperPlugin(): BuiltinPlugin;
|
|
12
|
+
export declare function wasmFallbackPlugin(): BuiltinPlugin;
|
|
13
|
+
export declare function loadFallbackPlugin(): BuiltinPlugin;
|
|
14
|
+
export declare function jsonPlugin(config?: BindingJsonPluginConfig): BuiltinPlugin;
|
|
15
|
+
export declare function buildImportAnalysisPlugin(config: BindingBuildImportAnalysisPluginConfig): BuiltinPlugin;
|
|
16
|
+
export declare function viteResolvePlugin(config: Omit<BindingViteResolvePluginConfig, 'runtime'>): BuiltinPlugin;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BindingReplacePluginConfig } from '../binding';
|
|
2
|
+
import { BuiltinPlugin } from './constructors';
|
|
3
|
+
/**
|
|
4
|
+
* Replaces targeted strings in files while bundling.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* // Basic usage
|
|
8
|
+
* ```js
|
|
9
|
+
* replacePlugin({
|
|
10
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
11
|
+
* __buildDate__: () => JSON.stringify(new Date()),
|
|
12
|
+
* __buildVersion: 15
|
|
13
|
+
* })
|
|
14
|
+
* ```
|
|
15
|
+
* @example
|
|
16
|
+
* // With options
|
|
17
|
+
* ```js
|
|
18
|
+
* replacePlugin({
|
|
19
|
+
* 'process.env.NODE_ENV': JSON.stringify('production'),
|
|
20
|
+
* __buildDate__: () => JSON.stringify(new Date()),
|
|
21
|
+
* __buildVersion: 15
|
|
22
|
+
* }, {
|
|
23
|
+
* preventAssignment: false,
|
|
24
|
+
* })
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export declare function replacePlugin(values?: BindingReplacePluginConfig['values'], options?: Omit<BindingReplacePluginConfig, 'values'>): BuiltinPlugin;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { BuiltinPlugin } from './constructors';
|
|
1
2
|
import { BindingTransformPluginConfig } from '../binding';
|
|
2
3
|
type TransformPattern = string | RegExp | (RegExp | string)[];
|
|
3
4
|
export type TransformPluginConfig = Omit<BindingTransformPluginConfig, 'include' | 'exclude'> & {
|
|
4
5
|
include?: TransformPattern;
|
|
5
6
|
exclude?: TransformPattern;
|
|
6
7
|
};
|
|
7
|
-
export declare function
|
|
8
|
+
export declare function transformPlugin(config?: TransformPluginConfig): BuiltinPlugin;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BindingBuiltinPlugin, BindingCallableBuiltinPlugin } from '../binding';
|
|
2
|
+
import { BuiltinPlugin } from './constructors';
|
|
3
|
+
type BindingCallableBuiltinPluginLike = {
|
|
4
|
+
[K in keyof BindingCallableBuiltinPlugin]: BindingCallableBuiltinPlugin[K];
|
|
5
|
+
};
|
|
6
|
+
export declare function makeBuiltinPluginCallable(plugin: BuiltinPlugin): BindingCallableBuiltinPluginLike & {
|
|
7
|
+
_original: BindingCallableBuiltinPlugin;
|
|
8
|
+
};
|
|
9
|
+
export declare function isCallableBuiltinPlugin(plugin: any): boolean;
|
|
10
|
+
export declare function bindingifyBuiltInPlugin(plugin: BuiltinPlugin): BindingBuiltinPlugin;
|
|
11
|
+
export declare function isCallableCompatibleBuiltinPlugin(plugin: any): plugin is BuiltinPlugin;
|
|
12
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CliOptions } from './schema';
|
|
2
|
-
import type { InputOptions } from '../../
|
|
3
|
-
import type { OutputOptions } from '../../
|
|
2
|
+
import type { InputOptions } from '../../options/input-options';
|
|
3
|
+
import type { OutputOptions } from '../../options/output-options';
|
|
4
4
|
export interface NormalizedCliOptions {
|
|
5
5
|
input: InputOptions;
|
|
6
6
|
output: OutputOptions;
|
|
@@ -3,4 +3,8 @@ export { experimental_scan as scan } from './rolldown';
|
|
|
3
3
|
export { transform } from './binding';
|
|
4
4
|
export type { TransformOptions, TransformResult } from './binding';
|
|
5
5
|
export { composeJsPlugins as composePlugins } from './utils/compose-js-plugins';
|
|
6
|
-
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin,
|
|
6
|
+
export { modulePreloadPolyfillPlugin, dynamicImportVarsPlugin, wasmHelperPlugin, wasmFallbackPlugin, importGlobPlugin, manifestPlugin, loadFallbackPlugin, jsonPlugin, buildImportAnalysisPlugin, viteResolvePlugin, } from './builtin-plugin/constructors';
|
|
7
|
+
export { transformPlugin } from './builtin-plugin/transform-plugin';
|
|
8
|
+
export { replacePlugin } from './builtin-plugin/replace-plugin';
|
|
9
|
+
export { aliasPlugin } from './builtin-plugin/alias-plugin';
|
|
10
|
+
export { isCallableCompatibleBuiltinPlugin, makeBuiltinPluginCallable, isCallableBuiltinPlugin, } from './builtin-plugin/utils';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RolldownOutput, RolldownOutputAsset, RolldownOutputChunk, SourceMap } from './types/rolldown-output';
|
|
2
|
-
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './
|
|
3
|
-
import type { ModuleFormat, OutputOptions } from './
|
|
2
|
+
import type { InputOptions, InputOption, ExternalOption, JsxOptions } from './options/input-options';
|
|
3
|
+
import type { ModuleFormat, OutputOptions } from './options/output-options';
|
|
4
4
|
import type { RolldownOptions } from './types/rolldown-options';
|
|
5
5
|
import type { AsyncPluginHooks, CustomPluginOptions, FunctionPluginHooks, ImportKind, LoadResult, ModuleOptions, ModuleType, ObjectHook, ParallelPluginHooks, PartialResolvedId, Plugin, RolldownPlugin, ResolveIdResult, ResolvedId, SourceDescription, TransformResult } from './plugin';
|
|
6
6
|
import { DefineParallelPluginResult } from './plugin/parallel-plugin';
|
|
@@ -15,10 +15,10 @@ import { RenderedChunk, PreRenderedChunk } from './binding';
|
|
|
15
15
|
import { PartialNull } from './types/utils';
|
|
16
16
|
import { NormalizedInputOptions } from './options/normalized-input-options';
|
|
17
17
|
import { ModuleInfo } from './types/module-info';
|
|
18
|
-
import { MinimalPluginContext } from './
|
|
18
|
+
import { MinimalPluginContext } from './plugin/minimal-plugin-context';
|
|
19
19
|
import { ExistingRawSourceMap, SourceMapInput } from './types/sourcemap';
|
|
20
20
|
import { OutputBundle } from './types/output-bundle';
|
|
21
|
-
import { WatchOptions } from './options/watch-
|
|
21
|
+
import { WatchOptions } from './options/watch-options';
|
|
22
22
|
import { Watcher } from './watcher';
|
|
23
23
|
export { defineConfig, rolldown, watch };
|
|
24
24
|
export declare const VERSION: string;
|
|
@@ -1,20 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LogHandler } from '../rollup';
|
|
2
2
|
import type { Plugin } from '../plugin';
|
|
3
3
|
import { type LogLevelOption } from './logging';
|
|
4
|
-
import type { InputOptions } from '../
|
|
5
|
-
import type { NormalizedInputOptions } from '../options/normalized-input-options';
|
|
6
|
-
export interface PluginContextMeta {
|
|
7
|
-
rollupVersion: string;
|
|
8
|
-
rolldownVersion: string;
|
|
9
|
-
watchMode: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare class MinimalPluginContext {
|
|
12
|
-
info: LoggingFunction;
|
|
13
|
-
warn: LoggingFunction;
|
|
14
|
-
debug: LoggingFunction;
|
|
15
|
-
meta: PluginContextMeta;
|
|
16
|
-
readonly error: (error: RollupError | string) => never;
|
|
17
|
-
constructor(options: NormalizedInputOptions, plugin: Plugin);
|
|
18
|
-
}
|
|
4
|
+
import type { InputOptions } from '../options/input-options';
|
|
19
5
|
export declare function getLogger(plugins: Plugin[], onLog: LogHandler, logLevel: LogLevelOption): LogHandler;
|
|
20
6
|
export declare const getOnLog: (config: InputOptions, logLevel: LogLevelOption, printLog?: LogHandler) => LogHandler;
|