@rollup/wasm-node 4.22.5 → 4.24.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.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -362,6 +362,8 @@ const URL_NAME_IS_NOT_EXPORTED = 'troubleshooting/#error-name-is-not-exported-by
362
362
  const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined';
363
363
  const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency';
364
364
  const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect';
365
+ // configuration-options
366
+ const URL_JSX = 'configuration-options/#jsx';
365
367
  const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id';
366
368
  const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath';
367
369
  const URL_OUTPUT_DIR = 'configuration-options/#output-dir';
@@ -383,6 +385,7 @@ const URL_TREESHAKE_PURE = 'configuration-options/#pure';
383
385
  const URL_TREESHAKE_NOSIDEEFFECTS = 'configuration-options/#no-side-effects';
384
386
  const URL_TREESHAKE_MODULESIDEEFFECTS = 'configuration-options/#treeshake-modulesideeffects';
385
387
  const URL_WATCH = 'configuration-options/#watch';
388
+ const URL_GENERATEBUNDLE = 'plugin-development/#generatebundle';
386
389
 
387
390
  function error(base) {
388
391
  throw base instanceof Error ? base : getRollupError(base);
@@ -437,7 +440,7 @@ function augmentLogMessage(log) {
437
440
  }
438
441
  // Error codes should be sorted alphabetically while errors should be sorted by
439
442
  // error code below
440
- const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', RESERVED_NAMESPACE = 'RESERVED_NAMESPACE', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR';
443
+ const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_JSX_EXPORT = 'MISSING_JSX_EXPORT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', RESERVED_NAMESPACE = 'RESERVED_NAMESPACE', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR';
441
444
  function logAddonNotGenerated(message, hook, plugin) {
442
445
  return {
443
446
  code: ADDON_ERROR,
@@ -796,6 +799,16 @@ function logImplicitDependantIsNotIncluded(module) {
796
799
  message: `Module "${relativeId(module.id)}" that should be implicitly loaded before ${printQuotedStringList(implicitDependencies)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
797
800
  };
798
801
  }
802
+ function logMissingJsxExport(name, exporter, importer) {
803
+ return {
804
+ code: MISSING_JSX_EXPORT,
805
+ exporter,
806
+ id: importer,
807
+ message: `Export "${name}" is not defined in module "${relativeId(exporter)}" even though it is needed in "${relativeId(importer)}" to provide JSX syntax. Please check your "jsx" option.`,
808
+ names: [name],
809
+ url: getRollupUrl(URL_JSX)
810
+ };
811
+ }
799
812
  function logMissingNameOptionForIifeExport() {
800
813
  return {
801
814
  code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT,
@@ -1049,7 +1062,7 @@ function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, pl
1049
1062
  warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onLog, options.strictDeprecations);
1050
1063
  }
1051
1064
  function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, log, strictDeprecations, plugin) {
1052
- {
1065
+ if (activeDeprecation || strictDeprecations) {
1053
1066
  const warning = logDeprecation(deprecation, urlSnippet);
1054
1067
  if (strictDeprecations) {
1055
1068
  return error(warning);
@@ -1498,6 +1511,138 @@ const nodeConverters = [
1498
1511
  local
1499
1512
  };
1500
1513
  },
1514
+ function jsxAttribute(position, buffer) {
1515
+ const valuePosition = buffer[position + 3];
1516
+ return {
1517
+ type: 'JSXAttribute',
1518
+ start: buffer[position],
1519
+ end: buffer[position + 1],
1520
+ name: convertNode(buffer[position + 2], buffer),
1521
+ value: valuePosition === 0 ? null : convertNode(valuePosition, buffer)
1522
+ };
1523
+ },
1524
+ function jsxClosingElement(position, buffer) {
1525
+ return {
1526
+ type: 'JSXClosingElement',
1527
+ start: buffer[position],
1528
+ end: buffer[position + 1],
1529
+ name: convertNode(buffer[position + 2], buffer)
1530
+ };
1531
+ },
1532
+ function jsxClosingFragment(position, buffer) {
1533
+ return {
1534
+ type: 'JSXClosingFragment',
1535
+ start: buffer[position],
1536
+ end: buffer[position + 1]
1537
+ };
1538
+ },
1539
+ function jsxElement(position, buffer) {
1540
+ const closingElementPosition = buffer[position + 4];
1541
+ return {
1542
+ type: 'JSXElement',
1543
+ start: buffer[position],
1544
+ end: buffer[position + 1],
1545
+ openingElement: convertNode(buffer[position + 2], buffer),
1546
+ children: convertNodeList(buffer[position + 3], buffer),
1547
+ closingElement: closingElementPosition === 0 ? null : convertNode(closingElementPosition, buffer)
1548
+ };
1549
+ },
1550
+ function jsxEmptyExpression(position, buffer) {
1551
+ return {
1552
+ type: 'JSXEmptyExpression',
1553
+ start: buffer[position],
1554
+ end: buffer[position + 1]
1555
+ };
1556
+ },
1557
+ function jsxExpressionContainer(position, buffer) {
1558
+ return {
1559
+ type: 'JSXExpressionContainer',
1560
+ start: buffer[position],
1561
+ end: buffer[position + 1],
1562
+ expression: convertNode(buffer[position + 2], buffer)
1563
+ };
1564
+ },
1565
+ function jsxFragment(position, buffer) {
1566
+ return {
1567
+ type: 'JSXFragment',
1568
+ start: buffer[position],
1569
+ end: buffer[position + 1],
1570
+ openingFragment: convertNode(buffer[position + 2], buffer),
1571
+ children: convertNodeList(buffer[position + 3], buffer),
1572
+ closingFragment: convertNode(buffer[position + 4], buffer)
1573
+ };
1574
+ },
1575
+ function jsxIdentifier(position, buffer) {
1576
+ return {
1577
+ type: 'JSXIdentifier',
1578
+ start: buffer[position],
1579
+ end: buffer[position + 1],
1580
+ name: buffer.convertString(buffer[position + 2])
1581
+ };
1582
+ },
1583
+ function jsxMemberExpression(position, buffer) {
1584
+ return {
1585
+ type: 'JSXMemberExpression',
1586
+ start: buffer[position],
1587
+ end: buffer[position + 1],
1588
+ object: convertNode(buffer[position + 2], buffer),
1589
+ property: convertNode(buffer[position + 3], buffer)
1590
+ };
1591
+ },
1592
+ function jsxNamespacedName(position, buffer) {
1593
+ return {
1594
+ type: 'JSXNamespacedName',
1595
+ start: buffer[position],
1596
+ end: buffer[position + 1],
1597
+ namespace: convertNode(buffer[position + 2], buffer),
1598
+ name: convertNode(buffer[position + 3], buffer)
1599
+ };
1600
+ },
1601
+ function jsxOpeningElement(position, buffer) {
1602
+ const flags = buffer[position + 2];
1603
+ return {
1604
+ type: 'JSXOpeningElement',
1605
+ start: buffer[position],
1606
+ end: buffer[position + 1],
1607
+ selfClosing: (flags & 1) === 1,
1608
+ name: convertNode(buffer[position + 3], buffer),
1609
+ attributes: convertNodeList(buffer[position + 4], buffer)
1610
+ };
1611
+ },
1612
+ function jsxOpeningFragment(position, buffer) {
1613
+ return {
1614
+ type: 'JSXOpeningFragment',
1615
+ start: buffer[position],
1616
+ end: buffer[position + 1],
1617
+ attributes: [],
1618
+ selfClosing: false
1619
+ };
1620
+ },
1621
+ function jsxSpreadAttribute(position, buffer) {
1622
+ return {
1623
+ type: 'JSXSpreadAttribute',
1624
+ start: buffer[position],
1625
+ end: buffer[position + 1],
1626
+ argument: convertNode(buffer[position + 2], buffer)
1627
+ };
1628
+ },
1629
+ function jsxSpreadChild(position, buffer) {
1630
+ return {
1631
+ type: 'JSXSpreadChild',
1632
+ start: buffer[position],
1633
+ end: buffer[position + 1],
1634
+ expression: convertNode(buffer[position + 2], buffer)
1635
+ };
1636
+ },
1637
+ function jsxText(position, buffer) {
1638
+ return {
1639
+ type: 'JSXText',
1640
+ start: buffer[position],
1641
+ end: buffer[position + 1],
1642
+ value: buffer.convertString(buffer[position + 2]),
1643
+ raw: buffer.convertString(buffer[position + 3])
1644
+ };
1645
+ },
1501
1646
  function labeledStatement(position, buffer) {
1502
1647
  return {
1503
1648
  type: 'LabeledStatement',
@@ -1920,7 +2065,7 @@ function getAstBuffer(astBuffer) {
1920
2065
  return Object.assign(array, { convertString });
1921
2066
  }
1922
2067
 
1923
- const parseAst = (input, { allowReturnOutsideFunction = false } = {}) => convertProgram(getAstBuffer(parse(input, allowReturnOutsideFunction)));
1924
- const parseAstAsync = async (input, { allowReturnOutsideFunction = false, signal } = {}) => convertProgram(getAstBuffer(await parseAsync(input, allowReturnOutsideFunction, signal)));
2068
+ const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(parse(input, allowReturnOutsideFunction, jsx)));
2069
+ const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await parseAsync(input, allowReturnOutsideFunction, jsx, signal)));
1925
2070
 
1926
- export { ANNOTATION_KEY, ArrowFunctionExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, INVALID_ANNOTATION_KEY, Identifier, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, Literal, Program, Property, ReturnStatement, StaticBlock, TemplateLiteral, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_SOURCEMAPFILE, URL_PRESERVEENTRYSIGNATURES, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_WATCH, VariableDeclarator, addTrailingSlashIfMissed, augmentCodeLocation, augmentLogMessage, convertAnnotations, convertNode, error, getAliasName, getAstBuffer, getImportPath, getRollupError, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularDependency, logCircularReexport, logConflictingSourcemapSources, logConstVariableReassignError, logCyclicCrossChunkReexport, logDuplicateArgumentNameError, logDuplicateExportError, logDuplicatePluginName, logEmptyChunk, logEntryCannotBeExternal, logEval, logExternalModulesCannotBeIncludedInManualChunks, logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logFailedValidation, logFileNameConflict, logFileReferenceIdNotFoundForFilename, logFirstSideEffect, logIllegalIdentifierAsName, logIllegalImportReassignment, logImplicitDependantCannotBeExternal, logImplicitDependantIsNotIncluded, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logIncompatibleExportOptionValue, logInconsistentImportAttributes, logInputHookInOutputPlugin, logInternalIdCannotBeExternal, logInvalidAddonPluginHook, logInvalidAnnotation, logInvalidExportOptionValue, logInvalidFormatForTopLevelAwait, logInvalidFunctionPluginHook, logInvalidLogPosition, logInvalidOption, logInvalidRollupPhaseForChunkEmission, logInvalidSetAssetSourceCall, logInvalidSourcemapForError, logLevelPriority, logMissingEntryExport, logMissingExport, logMissingFileOrDirOption, logMissingGlobalName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logOptimizeChunkStatus, logParseError, logPluginError, logRedeclarationError, logReservedNamespace, logShimmedExport, logSourcemapBroken, logSyntheticNamedExportsNeedNamespaceExport, logThisIsUndefined, logUnexpectedNamedImport, logUnexpectedNamespaceReexport, logUnknownOption, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logUnusedExternalImports, normalize, parseAst, parseAstAsync, printQuotedStringList, relative, relativeId, warnDeprecation };
2071
+ export { ANNOTATION_KEY, ArrowFunctionExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, INVALID_ANNOTATION_KEY, Identifier, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, Literal, Program, Property, ReturnStatement, StaticBlock, TemplateLiteral, URL_GENERATEBUNDLE, URL_JSX, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_SOURCEMAPFILE, URL_PRESERVEENTRYSIGNATURES, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_WATCH, VariableDeclarator, addTrailingSlashIfMissed, augmentCodeLocation, augmentLogMessage, convertAnnotations, convertNode, error, getAliasName, getAstBuffer, getImportPath, getRollupError, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularDependency, logCircularReexport, logConflictingSourcemapSources, logConstVariableReassignError, logCyclicCrossChunkReexport, logDuplicateArgumentNameError, logDuplicateExportError, logDuplicatePluginName, logEmptyChunk, logEntryCannotBeExternal, logEval, logExternalModulesCannotBeIncludedInManualChunks, logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logFailedValidation, logFileNameConflict, logFileReferenceIdNotFoundForFilename, logFirstSideEffect, logIllegalIdentifierAsName, logIllegalImportReassignment, logImplicitDependantCannotBeExternal, logImplicitDependantIsNotIncluded, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logIncompatibleExportOptionValue, logInconsistentImportAttributes, logInputHookInOutputPlugin, logInternalIdCannotBeExternal, logInvalidAddonPluginHook, logInvalidAnnotation, logInvalidExportOptionValue, logInvalidFormatForTopLevelAwait, logInvalidFunctionPluginHook, logInvalidLogPosition, logInvalidOption, logInvalidRollupPhaseForChunkEmission, logInvalidSetAssetSourceCall, logInvalidSourcemapForError, logLevelPriority, logMissingEntryExport, logMissingExport, logMissingFileOrDirOption, logMissingGlobalName, logMissingJsxExport, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logOptimizeChunkStatus, logParseError, logPluginError, logRedeclarationError, logReservedNamespace, logShimmedExport, logSourcemapBroken, logSyntheticNamedExportsNeedNamespaceExport, logThisIsUndefined, logUnexpectedNamedImport, logUnexpectedNamespaceReexport, logUnknownOption, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logUnusedExternalImports, normalize, parseAst, parseAstAsync, printQuotedStringList, relative, relativeId, warnDeprecation };
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/parseAst.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.d.ts CHANGED
@@ -220,7 +220,7 @@ type LoggingFunctionWithPosition = (
220
220
 
221
221
  export type ParseAst = (
222
222
  input: string,
223
- options?: { allowReturnOutsideFunction?: boolean }
223
+ options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean }
224
224
  ) => ProgramNode;
225
225
 
226
226
  // declare AbortSignal here for environments without DOM lib or @types/node
@@ -231,7 +231,7 @@ declare global {
231
231
 
232
232
  export type ParseAstAsync = (
233
233
  input: string,
234
- options?: { allowReturnOutsideFunction?: boolean; signal?: AbortSignal }
234
+ options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean; signal?: AbortSignal }
235
235
  ) => Promise<ProgramNode>;
236
236
 
237
237
  export interface PluginContext extends MinimalPluginContext {
@@ -523,6 +523,38 @@ export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
523
523
  api?: A;
524
524
  }
525
525
 
526
+ export type JsxPreset = 'react' | 'react-jsx' | 'preserve' | 'preserve-react';
527
+
528
+ export type NormalizedJsxOptions =
529
+ | NormalizedJsxPreserveOptions
530
+ | NormalizedJsxClassicOptions
531
+ | NormalizedJsxAutomaticOptions;
532
+
533
+ interface NormalizedJsxPreserveOptions {
534
+ factory: string | null;
535
+ fragment: string | null;
536
+ importSource: string | null;
537
+ mode: 'preserve';
538
+ }
539
+
540
+ interface NormalizedJsxClassicOptions {
541
+ factory: string;
542
+ fragment: string;
543
+ importSource: string | null;
544
+ mode: 'classic';
545
+ }
546
+
547
+ interface NormalizedJsxAutomaticOptions {
548
+ factory: string;
549
+ importSource: string | null;
550
+ jsxImportSource: string;
551
+ mode: 'automatic';
552
+ }
553
+
554
+ export type JsxOptions = Partial<NormalizedJsxOptions> & {
555
+ preset?: JsxPreset;
556
+ };
557
+
526
558
  export type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
527
559
 
528
560
  export interface NormalizedTreeshakingOptions {
@@ -545,6 +577,7 @@ interface ManualChunkMeta {
545
577
  getModuleIds: () => IterableIterator<string>;
546
578
  getModuleInfo: GetModuleInfo;
547
579
  }
580
+
548
581
  export type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
549
582
 
550
583
  export type ExternalOption =
@@ -592,6 +625,7 @@ export interface InputOptions {
592
625
  experimentalLogSideEffects?: boolean;
593
626
  external?: ExternalOption;
594
627
  input?: InputOption;
628
+ jsx?: false | JsxPreset | JsxOptions;
595
629
  logLevel?: LogLevelOption;
596
630
  makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
597
631
  maxParallelFileOps?: number;
@@ -619,6 +653,7 @@ export interface NormalizedInputOptions {
619
653
  experimentalLogSideEffects: boolean;
620
654
  external: IsExternal;
621
655
  input: string[] | Record<string, string>;
656
+ jsx: false | NormalizedJsxOptions;
622
657
  logLevel: LogLevelOption;
623
658
  makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
624
659
  maxParallelFileOps: number;
@@ -815,8 +850,12 @@ export type WarningHandlerWithDefault = (
815
850
  export type SerializedTimings = Record<string, [number, number, number]>;
816
851
 
817
852
  export interface PreRenderedAsset {
853
+ /** @deprecated Use "names" instead. */
818
854
  name: string | undefined;
855
+ names: string[];
856
+ /** @deprecated Use "originalFileNames" instead. */
819
857
  originalFileName: string | null;
858
+ originalFileNames: string[];
820
859
  source: string | Uint8Array;
821
860
  type: 'asset';
822
861
  }
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.22.5
4
- Fri, 27 Sep 2024 11:47:46 GMT - commit bc7780c322e134492f40a76bf64afe561670425c
3
+ Rollup.js v4.24.0
4
+ Wed, 02 Oct 2024 09:36:48 GMT - commit d3c000f4fd453e39a354299f0cfaa6831f56d7d8
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -249,6 +249,8 @@ const URL_NAME_IS_NOT_EXPORTED = 'troubleshooting/#error-name-is-not-exported-by
249
249
  const URL_THIS_IS_UNDEFINED = 'troubleshooting/#error-this-is-undefined';
250
250
  const URL_TREATING_MODULE_AS_EXTERNAL_DEPENDENCY = 'troubleshooting/#warning-treating-module-as-external-dependency';
251
251
  const URL_SOURCEMAP_IS_LIKELY_TO_BE_INCORRECT = 'troubleshooting/#warning-sourcemap-is-likely-to-be-incorrect';
252
+ // configuration-options
253
+ const URL_JSX = 'configuration-options/#jsx';
252
254
  const URL_OUTPUT_AMD_ID = 'configuration-options/#output-amd-id';
253
255
  const URL_OUTPUT_AMD_BASEPATH = 'configuration-options/#output-amd-basepath';
254
256
  const URL_OUTPUT_DIR = 'configuration-options/#output-dir';
@@ -273,6 +275,7 @@ const URL_WATCH = 'configuration-options/#watch';
273
275
  // command-line-interface
274
276
  const URL_BUNDLE_CONFIG_AS_CJS = 'command-line-interface/#bundleconfigascjs';
275
277
  const URL_CONFIGURATION_FILES = 'command-line-interface/#configuration-files';
278
+ const URL_GENERATEBUNDLE = 'plugin-development/#generatebundle';
276
279
 
277
280
  function error(base) {
278
281
  throw base instanceof Error ? base : getRollupError(base);
@@ -327,7 +330,7 @@ function augmentLogMessage(log) {
327
330
  }
328
331
  // Error codes should be sorted alphabetically while errors should be sorted by
329
332
  // error code below
330
- const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_IMPORT_OPTIONS = 'DUPLICATE_IMPORT_OPTIONS', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FAIL_AFTER_WARNINGS = 'FAIL_AFTER_WARNINGS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_CONFIG_MODULE_FORMAT = 'INVALID_CONFIG_MODULE_FORMAT', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_CONFIG = 'MISSING_CONFIG', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_EXTERNAL_CONFIG = 'MISSING_EXTERNAL_CONFIG', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', ONLY_INLINE_SOURCEMAPS = 'ONLY_INLINE_SOURCEMAPS', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', RESERVED_NAMESPACE = 'RESERVED_NAMESPACE', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR';
333
+ const ADDON_ERROR = 'ADDON_ERROR', ALREADY_CLOSED = 'ALREADY_CLOSED', AMBIGUOUS_EXTERNAL_NAMESPACES = 'AMBIGUOUS_EXTERNAL_NAMESPACES', ANONYMOUS_PLUGIN_CACHE = 'ANONYMOUS_PLUGIN_CACHE', ASSET_NOT_FINALISED = 'ASSET_NOT_FINALISED', ASSET_NOT_FOUND = 'ASSET_NOT_FOUND', ASSET_SOURCE_ALREADY_SET = 'ASSET_SOURCE_ALREADY_SET', ASSET_SOURCE_MISSING = 'ASSET_SOURCE_MISSING', BAD_LOADER = 'BAD_LOADER', CANNOT_CALL_NAMESPACE = 'CANNOT_CALL_NAMESPACE', CANNOT_EMIT_FROM_OPTIONS_HOOK = 'CANNOT_EMIT_FROM_OPTIONS_HOOK', CHUNK_NOT_GENERATED = 'CHUNK_NOT_GENERATED', CHUNK_INVALID = 'CHUNK_INVALID', CIRCULAR_DEPENDENCY = 'CIRCULAR_DEPENDENCY', CIRCULAR_REEXPORT = 'CIRCULAR_REEXPORT', CONST_REASSIGN = 'CONST_REASSIGN', CYCLIC_CROSS_CHUNK_REEXPORT = 'CYCLIC_CROSS_CHUNK_REEXPORT', DEPRECATED_FEATURE = 'DEPRECATED_FEATURE', DUPLICATE_ARGUMENT_NAME = 'DUPLICATE_ARGUMENT_NAME', DUPLICATE_EXPORT = 'DUPLICATE_EXPORT', DUPLICATE_IMPORT_OPTIONS = 'DUPLICATE_IMPORT_OPTIONS', DUPLICATE_PLUGIN_NAME = 'DUPLICATE_PLUGIN_NAME', EMPTY_BUNDLE = 'EMPTY_BUNDLE', EVAL = 'EVAL', EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS = 'EXTERNAL_MODULES_CANNOT_BE_INCLUDED_IN_MANUAL_CHUNKS', EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES = 'EXTERNAL_MODULES_CANNOT_BE_TRANSFORMED_TO_MODULES', EXTERNAL_SYNTHETIC_EXPORTS = 'EXTERNAL_SYNTHETIC_EXPORTS', FAIL_AFTER_WARNINGS = 'FAIL_AFTER_WARNINGS', FILE_NAME_CONFLICT = 'FILE_NAME_CONFLICT', FILE_NOT_FOUND = 'FILE_NOT_FOUND', FIRST_SIDE_EFFECT = 'FIRST_SIDE_EFFECT', ILLEGAL_IDENTIFIER_AS_NAME = 'ILLEGAL_IDENTIFIER_AS_NAME', ILLEGAL_REASSIGNMENT = 'ILLEGAL_REASSIGNMENT', INCONSISTENT_IMPORT_ATTRIBUTES = 'INCONSISTENT_IMPORT_ATTRIBUTES', INVALID_ANNOTATION = 'INVALID_ANNOTATION', INPUT_HOOK_IN_OUTPUT_PLUGIN = 'INPUT_HOOK_IN_OUTPUT_PLUGIN', INVALID_CHUNK = 'INVALID_CHUNK', INVALID_CONFIG_MODULE_FORMAT = 'INVALID_CONFIG_MODULE_FORMAT', INVALID_EXPORT_OPTION = 'INVALID_EXPORT_OPTION', INVALID_EXTERNAL_ID = 'INVALID_EXTERNAL_ID', INVALID_IMPORT_ATTRIBUTE = 'INVALID_IMPORT_ATTRIBUTE', INVALID_LOG_POSITION = 'INVALID_LOG_POSITION', INVALID_OPTION = 'INVALID_OPTION', INVALID_PLUGIN_HOOK = 'INVALID_PLUGIN_HOOK', INVALID_ROLLUP_PHASE = 'INVALID_ROLLUP_PHASE', INVALID_SETASSETSOURCE = 'INVALID_SETASSETSOURCE', INVALID_TLA_FORMAT = 'INVALID_TLA_FORMAT', MISSING_CONFIG = 'MISSING_CONFIG', MISSING_EXPORT = 'MISSING_EXPORT', MISSING_EXTERNAL_CONFIG = 'MISSING_EXTERNAL_CONFIG', MISSING_GLOBAL_NAME = 'MISSING_GLOBAL_NAME', MISSING_IMPLICIT_DEPENDANT = 'MISSING_IMPLICIT_DEPENDANT', MISSING_JSX_EXPORT = 'MISSING_JSX_EXPORT', MISSING_NAME_OPTION_FOR_IIFE_EXPORT = 'MISSING_NAME_OPTION_FOR_IIFE_EXPORT', MISSING_NODE_BUILTINS = 'MISSING_NODE_BUILTINS', MISSING_OPTION = 'MISSING_OPTION', MIXED_EXPORTS = 'MIXED_EXPORTS', MODULE_LEVEL_DIRECTIVE = 'MODULE_LEVEL_DIRECTIVE', NAMESPACE_CONFLICT = 'NAMESPACE_CONFLICT', NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE = 'NO_TRANSFORM_MAP_OR_AST_WITHOUT_CODE', ONLY_INLINE_SOURCEMAPS = 'ONLY_INLINE_SOURCEMAPS', OPTIMIZE_CHUNK_STATUS = 'OPTIMIZE_CHUNK_STATUS', PARSE_ERROR = 'PARSE_ERROR', PLUGIN_ERROR = 'PLUGIN_ERROR', REDECLARATION_ERROR = 'REDECLARATION_ERROR', RESERVED_NAMESPACE = 'RESERVED_NAMESPACE', SHIMMED_EXPORT = 'SHIMMED_EXPORT', SOURCEMAP_BROKEN = 'SOURCEMAP_BROKEN', SOURCEMAP_ERROR = 'SOURCEMAP_ERROR', SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT = 'SYNTHETIC_NAMED_EXPORTS_NEED_NAMESPACE_EXPORT', THIS_IS_UNDEFINED = 'THIS_IS_UNDEFINED', UNEXPECTED_NAMED_IMPORT = 'UNEXPECTED_NAMED_IMPORT', UNKNOWN_OPTION = 'UNKNOWN_OPTION', UNRESOLVED_ENTRY = 'UNRESOLVED_ENTRY', UNRESOLVED_IMPORT = 'UNRESOLVED_IMPORT', UNUSED_EXTERNAL_IMPORT = 'UNUSED_EXTERNAL_IMPORT', VALIDATION_ERROR = 'VALIDATION_ERROR';
331
334
  function logAddonNotGenerated(message, hook, plugin) {
332
335
  return {
333
336
  code: ADDON_ERROR,
@@ -738,6 +741,16 @@ function logImplicitDependantIsNotIncluded(module) {
738
741
  message: `Module "${relativeId(module.id)}" that should be implicitly loaded before ${printQuotedStringList(implicitDependencies)} is not included in the module graph. Either it was not imported by an included module or only via a tree-shaken dynamic import, or no imported bindings were used and it had otherwise no side-effects.`
739
742
  };
740
743
  }
744
+ function logMissingJsxExport(name, exporter, importer) {
745
+ return {
746
+ code: MISSING_JSX_EXPORT,
747
+ exporter,
748
+ id: importer,
749
+ message: `Export "${name}" is not defined in module "${relativeId(exporter)}" even though it is needed in "${relativeId(importer)}" to provide JSX syntax. Please check your "jsx" option.`,
750
+ names: [name],
751
+ url: getRollupUrl(URL_JSX)
752
+ };
753
+ }
741
754
  function logMissingNameOptionForIifeExport() {
742
755
  return {
743
756
  code: MISSING_NAME_OPTION_FOR_IIFE_EXPORT,
@@ -997,7 +1010,7 @@ function warnDeprecation(deprecation, urlSnippet, activeDeprecation, options, pl
997
1010
  warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, options.onLog, options.strictDeprecations);
998
1011
  }
999
1012
  function warnDeprecationWithOptions(deprecation, urlSnippet, activeDeprecation, log, strictDeprecations, plugin) {
1000
- {
1013
+ if (activeDeprecation || strictDeprecations) {
1001
1014
  const warning = logDeprecation(deprecation, urlSnippet);
1002
1015
  if (strictDeprecations) {
1003
1016
  return error(warning);
@@ -1561,6 +1574,138 @@ const nodeConverters = [
1561
1574
  local
1562
1575
  };
1563
1576
  },
1577
+ function jsxAttribute(position, buffer) {
1578
+ const valuePosition = buffer[position + 3];
1579
+ return {
1580
+ type: 'JSXAttribute',
1581
+ start: buffer[position],
1582
+ end: buffer[position + 1],
1583
+ name: convertNode(buffer[position + 2], buffer),
1584
+ value: valuePosition === 0 ? null : convertNode(valuePosition, buffer)
1585
+ };
1586
+ },
1587
+ function jsxClosingElement(position, buffer) {
1588
+ return {
1589
+ type: 'JSXClosingElement',
1590
+ start: buffer[position],
1591
+ end: buffer[position + 1],
1592
+ name: convertNode(buffer[position + 2], buffer)
1593
+ };
1594
+ },
1595
+ function jsxClosingFragment(position, buffer) {
1596
+ return {
1597
+ type: 'JSXClosingFragment',
1598
+ start: buffer[position],
1599
+ end: buffer[position + 1]
1600
+ };
1601
+ },
1602
+ function jsxElement(position, buffer) {
1603
+ const closingElementPosition = buffer[position + 4];
1604
+ return {
1605
+ type: 'JSXElement',
1606
+ start: buffer[position],
1607
+ end: buffer[position + 1],
1608
+ openingElement: convertNode(buffer[position + 2], buffer),
1609
+ children: convertNodeList(buffer[position + 3], buffer),
1610
+ closingElement: closingElementPosition === 0 ? null : convertNode(closingElementPosition, buffer)
1611
+ };
1612
+ },
1613
+ function jsxEmptyExpression(position, buffer) {
1614
+ return {
1615
+ type: 'JSXEmptyExpression',
1616
+ start: buffer[position],
1617
+ end: buffer[position + 1]
1618
+ };
1619
+ },
1620
+ function jsxExpressionContainer(position, buffer) {
1621
+ return {
1622
+ type: 'JSXExpressionContainer',
1623
+ start: buffer[position],
1624
+ end: buffer[position + 1],
1625
+ expression: convertNode(buffer[position + 2], buffer)
1626
+ };
1627
+ },
1628
+ function jsxFragment(position, buffer) {
1629
+ return {
1630
+ type: 'JSXFragment',
1631
+ start: buffer[position],
1632
+ end: buffer[position + 1],
1633
+ openingFragment: convertNode(buffer[position + 2], buffer),
1634
+ children: convertNodeList(buffer[position + 3], buffer),
1635
+ closingFragment: convertNode(buffer[position + 4], buffer)
1636
+ };
1637
+ },
1638
+ function jsxIdentifier(position, buffer) {
1639
+ return {
1640
+ type: 'JSXIdentifier',
1641
+ start: buffer[position],
1642
+ end: buffer[position + 1],
1643
+ name: buffer.convertString(buffer[position + 2])
1644
+ };
1645
+ },
1646
+ function jsxMemberExpression(position, buffer) {
1647
+ return {
1648
+ type: 'JSXMemberExpression',
1649
+ start: buffer[position],
1650
+ end: buffer[position + 1],
1651
+ object: convertNode(buffer[position + 2], buffer),
1652
+ property: convertNode(buffer[position + 3], buffer)
1653
+ };
1654
+ },
1655
+ function jsxNamespacedName(position, buffer) {
1656
+ return {
1657
+ type: 'JSXNamespacedName',
1658
+ start: buffer[position],
1659
+ end: buffer[position + 1],
1660
+ namespace: convertNode(buffer[position + 2], buffer),
1661
+ name: convertNode(buffer[position + 3], buffer)
1662
+ };
1663
+ },
1664
+ function jsxOpeningElement(position, buffer) {
1665
+ const flags = buffer[position + 2];
1666
+ return {
1667
+ type: 'JSXOpeningElement',
1668
+ start: buffer[position],
1669
+ end: buffer[position + 1],
1670
+ selfClosing: (flags & 1) === 1,
1671
+ name: convertNode(buffer[position + 3], buffer),
1672
+ attributes: convertNodeList(buffer[position + 4], buffer)
1673
+ };
1674
+ },
1675
+ function jsxOpeningFragment(position, buffer) {
1676
+ return {
1677
+ type: 'JSXOpeningFragment',
1678
+ start: buffer[position],
1679
+ end: buffer[position + 1],
1680
+ attributes: [],
1681
+ selfClosing: false
1682
+ };
1683
+ },
1684
+ function jsxSpreadAttribute(position, buffer) {
1685
+ return {
1686
+ type: 'JSXSpreadAttribute',
1687
+ start: buffer[position],
1688
+ end: buffer[position + 1],
1689
+ argument: convertNode(buffer[position + 2], buffer)
1690
+ };
1691
+ },
1692
+ function jsxSpreadChild(position, buffer) {
1693
+ return {
1694
+ type: 'JSXSpreadChild',
1695
+ start: buffer[position],
1696
+ end: buffer[position + 1],
1697
+ expression: convertNode(buffer[position + 2], buffer)
1698
+ };
1699
+ },
1700
+ function jsxText(position, buffer) {
1701
+ return {
1702
+ type: 'JSXText',
1703
+ start: buffer[position],
1704
+ end: buffer[position + 1],
1705
+ value: buffer.convertString(buffer[position + 2]),
1706
+ raw: buffer.convertString(buffer[position + 3])
1707
+ };
1708
+ },
1564
1709
  function labeledStatement(position, buffer) {
1565
1710
  return {
1566
1711
  type: 'LabeledStatement',
@@ -1983,8 +2128,8 @@ function getAstBuffer(astBuffer) {
1983
2128
  return Object.assign(array, { convertString });
1984
2129
  }
1985
2130
 
1986
- const parseAst = (input, { allowReturnOutsideFunction = false } = {}) => convertProgram(getAstBuffer(native_js.parse(input, allowReturnOutsideFunction)));
1987
- const parseAstAsync = async (input, { allowReturnOutsideFunction = false, signal } = {}) => convertProgram(getAstBuffer(await native_js.parseAsync(input, allowReturnOutsideFunction, signal)));
2131
+ const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(native_js.parse(input, allowReturnOutsideFunction, jsx)));
2132
+ const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await native_js.parseAsync(input, allowReturnOutsideFunction, jsx, signal)));
1988
2133
 
1989
2134
  exports.ANNOTATION_KEY = ANNOTATION_KEY;
1990
2135
  exports.ArrowFunctionExpression = ArrowFunctionExpression;
@@ -2011,6 +2156,8 @@ exports.ReturnStatement = ReturnStatement;
2011
2156
  exports.StaticBlock = StaticBlock;
2012
2157
  exports.TemplateLiteral = TemplateLiteral;
2013
2158
  exports.URL_AVOIDING_EVAL = URL_AVOIDING_EVAL;
2159
+ exports.URL_GENERATEBUNDLE = URL_GENERATEBUNDLE;
2160
+ exports.URL_JSX = URL_JSX;
2014
2161
  exports.URL_NAME_IS_NOT_EXPORTED = URL_NAME_IS_NOT_EXPORTED;
2015
2162
  exports.URL_OUTPUT_AMD_BASEPATH = URL_OUTPUT_AMD_BASEPATH;
2016
2163
  exports.URL_OUTPUT_AMD_ID = URL_OUTPUT_AMD_ID;
@@ -2112,6 +2259,7 @@ exports.logMissingExport = logMissingExport;
2112
2259
  exports.logMissingExternalConfig = logMissingExternalConfig;
2113
2260
  exports.logMissingFileOrDirOption = logMissingFileOrDirOption;
2114
2261
  exports.logMissingGlobalName = logMissingGlobalName;
2262
+ exports.logMissingJsxExport = logMissingJsxExport;
2115
2263
  exports.logMissingNameOptionForIifeExport = logMissingNameOptionForIifeExport;
2116
2264
  exports.logMissingNameOptionForUmdExport = logMissingNameOptionForUmdExport;
2117
2265
  exports.logMissingNodeBuiltins = logMissingNodeBuiltins;