diff --git a/cli/help.md b/cli/help.md index 8c5560d02..10a1e9b2b 100644 --- a/cli/help.md +++ b/cli/help.md @@ -6,7 +6,9 @@ Usage: rollup [options] Basic options: -c, --config Use this config file (if argument is used but value - is unspecified, defaults to rollup.config.js) + is unspecified, Rollup will try to load configuration files + in the following order: + rollup.config.mjs -> rollup.config.cjs -> rollup.config.js) -d, --dir Directory for chunks (if absent, prints to stdout) -e, --external Comma-separate list of module IDs to exclude -f, --format Type of output (amd, cjs, es, iife, umd, system) diff --git a/docs/command-line-interface/index.md b/docs/command-line-interface/index.md index 2373a0b5c..117bb03be 100755 --- a/docs/command-line-interface/index.md +++ b/docs/command-line-interface/index.md @@ -375,6 +375,7 @@ export default { 许多选项都有等效的命令行标志。在这些情况下,如果你正在使用配置文件,则此处传递的任何参数都将覆盖配置文件。以下是所有支持的选项列表: ``` +<<<<<<< HEAD -c, --config 使用此配置文件 (如果使用参数但未指定值,则默认为 rollup.config.js) -d, --dir 用于块的目录(如果不存在,则打印到 stdout) @@ -471,6 +472,107 @@ export default { --watch.onError 在 "ERROR" 事件上运行的 Shell 命令 --watch.onStart 在 "START" 事件上运行的 Shell 命令 --watch.skipWrite 在监视时不要将文件写入磁盘 +======= +-c, --config Use this config file (if argument is used but value + is unspecified, Rollup will try to load configuration files + in the following order: + rollup.config.mjs -> rollup.config.cjs -> rollup.config.js) +-d, --dir Directory for chunks (if absent, prints to stdout) +-e, --external Comma-separate list of module IDs to exclude +-f, --format Type of output (amd, cjs, es, iife, umd, system) +-g, --globals Comma-separate list of `moduleID:Global` pairs +-h, --help Show this help message +-i, --input Input (alternative to ) +-m, --sourcemap Generate sourcemap (`-m inline` for inline map) +-n, --name Name for UMD export +-o, --file Single output file (if absent, prints to stdout) +-p, --plugin Use the plugin specified (may be repeated) +-v, --version Show version number +-w, --watch Watch files in bundle and rebuild on changes +--amd.autoId Generate the AMD ID based off the chunk name +--amd.basePath Path to prepend to auto generated AMD ID +--amd.define Function to use in place of `define` +--amd.forceJsExtensionForImports Use `.js` extension in AMD imports +--amd.id ID for AMD module (default is anonymous) +--assetFileNames Name pattern for emitted assets +--banner Code to insert at top of bundle (outside wrapper) +--chunkFileNames Name pattern for emitted secondary chunks +--compact Minify wrapper code +--context Specify top-level `this` value +--no-dynamicImportInCjs Write external dynamic CommonJS imports as require +--entryFileNames Name pattern for emitted entry chunks +--environment Settings passed to config file (see example) +--no-esModule Do not add __esModule property +--exports Specify export mode (auto, default, named, none) +--extend Extend global variable defined by --name +--no-externalImportAttributes Omit import attributes in "es" output +--no-externalLiveBindings Do not generate code to support live bindings +--failAfterWarnings Exit with an error if the build produced warnings +--filterLogs Filter log messages +--footer Code to insert at end of bundle (outside wrapper) +--forceExit Force exit the process when done +--no-freeze Do not freeze namespace objects +--generatedCode Which code features to use (es5/es2015) +--generatedCode.arrowFunctions Use arrow functions in generated code +--generatedCode.constBindings Use "const" in generated code +--generatedCode.objectShorthand Use shorthand properties in generated code +--no-generatedCode.reservedNamesAsProps Always quote reserved names as props +--generatedCode.symbols Use symbols in generated code +--hashCharacters Use the specified character set for file hashes +--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks +--importAttributesKey Use the specified keyword for import attributes +--no-indent Don't indent result +--inlineDynamicImports Create single bundle when using dynamic imports +--no-interop Do not include interop block +--intro Code to insert at top of bundle (inside wrapper) +--logLevel Which kind of logs to display +--no-makeAbsoluteExternalsRelative Prevent normalization of external imports +--maxParallelFileOps How many files to read in parallel +--minifyInternalExports Force or disable minification of internal exports +--noConflict Generate a noConflict method for UMD globals +--outro Code to insert at end of bundle (inside wrapper) +--perf Display performance timings +--no-preserveEntrySignatures Avoid facade chunks for entry points +--preserveModules Preserve module structure +--preserveModulesRoot Put preserved modules under this path at root level +--preserveSymlinks Do not follow symlinks when resolving files +--no-reexportProtoFromExternal Ignore `__proto__` in star re-exports +--no-sanitizeFileName Do not replace invalid characters in file names +--shimMissingExports Create shim variables for missing exports +--silent Don't print warnings +--sourcemapBaseUrl Emit absolute sourcemap URLs with given base +--sourcemapDebugIds Emit unique debug ids in source and sourcemaps +--sourcemapExcludeSources Do not include source code in source maps +--sourcemapFile Specify bundle position for source maps +--sourcemapFileNames Name pattern for emitted sourcemaps +--stdin=ext Specify file extension used for stdin input +--no-stdin Do not read "-" from stdin +--no-strict Don't emit `"use strict";` in the generated modules +--strictDeprecations Throw errors for deprecated features +--no-systemNullSetters Do not replace empty SystemJS setters with `null` +--no-treeshake Disable tree-shaking optimisations +--no-treeshake.annotations Ignore pure call annotations +--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared +--treeshake.manualPureFunctions Manually declare functions as pure +--no-treeshake.moduleSideEffects Assume modules have no side effects +--no-treeshake.propertyReadSideEffects Ignore property access side effects +--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking +--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw +--validate Validate output +--waitForBundleInput Wait for bundle input files +--watch.allowInputInsideOutputPath Whether the input path is allowed to be a + subpath of the output path +--watch.buildDelay Throttle watch rebuilds +--no-watch.clearScreen Do not clear the screen when rebuilding +--watch.exclude Exclude files from being watched +--watch.include Limit watching to specified files +--watch.onBundleEnd Shell command to run on `"BUNDLE_END"` event +--watch.onBundleStart Shell command to run on `"BUNDLE_START"` event +--watch.onEnd Shell command to run on `"END"` event +--watch.onError Shell command to run on `"ERROR"` event +--watch.onStart Shell command to run on `"START"` event +--watch.skipWrite Do not write files to disk when watching +>>>>>>> 6166a59adffd6eb757c0e46becff4a8fcb47948a ``` 以下标志仅通过命令行界面可用。所有其他标志都对应并覆盖其配置文件等效项,请参阅[选项大列表](../configuration-options/index.md)获取详细信息。 diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 039360738..eb3269bbd 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1316,9 +1316,9 @@ dependencies = [ [[package]] name = "swc_compiler_base" -version = "41.0.0" +version = "43.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1583da0d977424f5b637daf962cd8b0a08115c2e5b1e4563c8a159b19f5c3ba" +checksum = "651029fd98d105e6082dff8a77b637b9cbe73938203ef2d7b0276dbab486860c" dependencies = [ "anyhow", "base64", @@ -1430,9 +1430,9 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "38.0.1" +version = "40.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c8d16175fe77d4df22505885ae16770c72b440898a2c7d44126a599bdb8488" +checksum = "767255ba2a7b13a2d4985313afbc69787e2b40fc9ffe00a3ddacb9c6c659066c" dependencies = [ "arrayvec", "bitflags", @@ -1466,9 +1466,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "29.0.2" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63984b544fe1d8f66e9ce616e57429bb878572fcf1504851ef9d9f4f5260e2b" +checksum = "3fb84a1b1b605c85c38a982f8f6dac4908ca73721aee9f9924d6a60e27339290" dependencies = [ "bitflags", "either", @@ -1487,9 +1487,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "32.0.0" +version = "33.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "499486ed875ba49af2f36d0d809f61ce6e42943a3aa1d97f592d96f10fe734cc" +checksum = "00691748cc689f93316bb699051eadf058852b6326930c0355fe375110318ab5" dependencies = [ "better_scoped_tls", "indexmap", @@ -1509,9 +1509,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "34.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7678b46f04eff0937a86bf98b2db3235818e10cfd63590653482302a905c3911" +checksum = "78357477172085963b461ae9afd1724b607d2314298d732c5504676f96df21af" dependencies = [ "bytes-str", "dashmap", @@ -1533,9 +1533,9 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "26.0.0" +version = "27.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb7998f23f765b1fad1e8e015e9f58a0cdff31bfec783f708aa416e44bd5fd2" +checksum = "2e5215c48b139422dcf54958d746b5e9a7b31bab8fc126f28e4049c4985505d5" dependencies = [ "bitflags", "indexmap", diff --git a/rust/parse_ast/Cargo.toml b/rust/parse_ast/Cargo.toml index 2dd6781e6..407a5927a 100644 --- a/rust/parse_ast/Cargo.toml +++ b/rust/parse_ast/Cargo.toml @@ -8,9 +8,9 @@ edition = "2021" [dependencies] anyhow = "1.0.100" swc_atoms = "9.0.0" -swc_compiler_base = "41.0.0" +swc_compiler_base = "43.0.0" swc_config = "3.1.2" swc_common = { version = "18.0.1", features = ["parking_lot"] } swc_ecma_ast = "19.0.0" -swc_ecma_parser = "29.0.2" +swc_ecma_parser = "30.0.0" parking_lot = "0.12.5" diff --git a/test/watch/index.js b/test/watch/index.js index 988dab98d..168edf7b6 100644 --- a/test/watch/index.js +++ b/test/watch/index.js @@ -565,7 +565,7 @@ describe('rollup.watch', function () { }, 'START', 'BUNDLE_START', - "ERROR:main.js (1:7): Expected '{', got 'nope'", + "ERROR:main.js (1:7): Expected '{', got 'ident'", 'END', () => { atomicWriteFileSync(ENTRY_FILE, 'export default 43;'); @@ -713,7 +713,7 @@ describe('rollup.watch', function () { }, 'START', 'BUNDLE_START', - "ERROR:main.js (1:7): Expected '{', got 'nope'", + "ERROR:main.js (1:7): Expected '{', got 'ident'", 'END', () => { unlinkSync(ENTRY_FILE); @@ -751,7 +751,7 @@ describe('rollup.watch', function () { }, 'START', 'BUNDLE_START', - "ERROR:dep.js (1:7): Expected '{', got 'nope'", + "ERROR:dep.js (1:7): Expected '{', got 'ident'", 'END', () => { unlinkSync(path.join(INPUT_DIR, 'dep.js'));