@jsenv/core 26.0.1 → 27.0.0-alpha.10
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/main.js +17 -24
- package/package.json +35 -71
- package/readme.md +30 -37
- package/src/build/build.js +867 -0
- package/src/build/build_urls_generator.js +73 -0
- package/src/build/inject_service_worker_urls.js +25 -0
- package/src/build/inject_version_mappings.js +63 -0
- package/src/build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js +227 -0
- package/src/build/plugins/minify_html/jsenv_plugin_minify_html.js +30 -0
- package/src/build/plugins/minify_js/jsenv_plugin_minify_js.js +47 -0
- package/src/dev/plugins/autoreload/babel_plugin_metadata_import_meta_hot.js +98 -0
- package/src/dev/plugins/autoreload/client/autoreload_preference.js +11 -0
- package/src/dev/plugins/autoreload/client/event_source_client.js +186 -0
- package/src/{internal/dev_server/event_source_client → dev/plugins/autoreload/client}/event_source_connection.js +21 -25
- package/src/dev/plugins/autoreload/client/import_meta_hot.js +80 -0
- package/src/dev/plugins/autoreload/client/reload.js +101 -0
- package/src/dev/plugins/autoreload/client/url_helpers.js +20 -0
- package/src/dev/plugins/autoreload/html_hot_dependencies.js +156 -0
- package/src/dev/plugins/autoreload/jsenv_plugin_autoreload.js +374 -0
- package/src/dev/plugins/autoreload/sse_service.js +149 -0
- package/src/dev/plugins/explorer/client/explorer.html +607 -0
- package/src/{internal → dev/plugins/explorer/client}/jsenv.png +0 -0
- package/src/dev/plugins/explorer/jsenv_plugin_explorer.js +74 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/animation/toolbar_animation.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/eventsource/eventsource.css +2 -2
- package/src/dev/plugins/toolbar/client/eventsource/toolbar_eventsource.js +57 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/execution/execution.css +0 -0
- package/src/dev/plugins/toolbar/client/execution/toolbar_execution.js +88 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/focus.css +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/focus/toolbar_focus.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/jsenv_logo.svg +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/notification/toolbar_notification.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/overflow_menu.css +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/responsive/toolbar_responsive.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/settings.css +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/settings/toolbar_settings.js +1 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/jsenv_theme.css +1 -15
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/light_theme.css +0 -17
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/theme/toolbar_theme.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar.html +40 -199
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_injector.js +8 -28
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.css +0 -24
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/toolbar_main.js +10 -56
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.css +1 -1
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/tooltip/tooltip.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/animation.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/dom.js +0 -0
- package/src/{internal/browser_utils → dev/plugins/toolbar/client/util}/fetch_using_xhr.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/fetching.js +2 -4
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/iframe_to_parent_href.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/jsenv_logger.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/preferences.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/responsive.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/util/util.js +0 -0
- package/src/{internal/dev_server/toolbar → dev/plugins/toolbar/client}/variant/variant.js +0 -0
- package/src/dev/plugins/toolbar/jsenv_plugin_toolbar.js +62 -0
- package/src/dev/start_dev_server.js +108 -0
- package/src/execute/execute.js +138 -0
- package/src/execute/run.js +208 -0
- package/src/execute/runtimes/browsers/chromium.js +8 -0
- package/src/execute/runtimes/browsers/firefox.js +7 -0
- package/src/execute/runtimes/browsers/from_playwright.js +464 -0
- package/src/{browser_runtimes.js → execute/runtimes/browsers/webkit.js} +4 -18
- package/src/{internal/node_launcher/child_process_options.js → execute/runtimes/node/child_exec_options.js} +25 -36
- package/src/{internal/node_launcher/node_controllable_file.mjs → execute/runtimes/node/controllable_file.mjs} +1 -18
- package/src/{internal/node_launcher/node_controllable_process.js → execute/runtimes/node/controlled_process.js} +128 -150
- package/src/execute/runtimes/node/exec_options.js +44 -0
- package/src/{internal/node_launcher → execute/runtimes/node}/kill_process_tree.js +3 -1
- package/src/execute/runtimes/node/node_process.js +92 -0
- package/src/execute/runtimes/node/node_worker_thread.js +28 -0
- package/src/omega/core_plugins/babel/global_this/babel_plugin_global_this_as_jsenv_import.js +35 -0
- package/{helpers/global-this/global-this.js → src/omega/core_plugins/babel/global_this/client/global_this.js} +0 -0
- package/src/{internal/compile_server/js → omega/core_plugins/babel/helpers}/babel_plugin_babel_helpers_as_jsenv_imports.js +15 -20
- package/src/omega/core_plugins/babel/helpers/babel_plugin_structure.js +176 -0
- package/src/{internal/features → omega/core_plugins/babel/helpers}/babel_plugins_compatibility.js +1 -24
- package/src/omega/core_plugins/babel/jsenv_plugin_babel.js +111 -0
- package/src/omega/core_plugins/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +117 -0
- package/{helpers/babel → src/omega/core_plugins/babel/new_stylesheet/client}/.eslintrc.cjs +1 -1
- package/{helpers/new_stylesheet → src/omega/core_plugins/babel/new_stylesheet/client}/new_stylesheet.js +0 -0
- package/src/omega/core_plugins/babel/regenerator_runtime/babel_plugin_regenerator_runtime_as_jsenv_import.js +34 -0
- package/{helpers/regenerator-runtime/regenerator-runtime.js → src/omega/core_plugins/babel/regenerator_runtime/client/regenerator_runtime.js} +0 -0
- package/src/omega/core_plugins/commonjs_globals/jsenv_plugin_commonjs_globals.js +169 -0
- package/src/omega/core_plugins/file_urls/jsenv_plugin_file_urls.js +67 -0
- package/src/omega/core_plugins/filesystem_magic/jsenv_plugin_filesystem_magic.js +58 -0
- package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_document.js +10 -16
- package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/error_in_notification.js +0 -0
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_installer.js +168 -0
- package/src/omega/core_plugins/html_supervisor/client/html_supervisor_setup.js +77 -0
- package/src/{internal/browser_client → omega/core_plugins/html_supervisor/client}/perf_browser.js +0 -0
- package/src/{internal/runtime_client → omega/core_plugins/html_supervisor/client}/uneval_exception.js +0 -0
- package/src/omega/core_plugins/html_supervisor/jsenv_plugin_html_supervisor.js +233 -0
- package/src/omega/core_plugins/import_assertions/helpers/babel_plugin_metadata_import_assertions.js +98 -0
- package/src/{internal/building/import_assertions → omega/core_plugins/import_assertions/helpers}/json_module.js +3 -2
- package/src/omega/core_plugins/import_assertions/helpers/text_module.js +6 -0
- package/src/omega/core_plugins/import_assertions/jsenv_plugin_import_assertions.js +211 -0
- package/src/omega/core_plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +90 -0
- package/src/omega/core_plugins/importmap/jsenv_plugin_importmap.js +212 -0
- package/src/omega/core_plugins/inject_globals/jsenv_plugin_inject_globals.js +27 -0
- package/src/omega/core_plugins/inline/client/inline_content.js +6 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_data_urls.js +70 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_inline.js +13 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_inline_query_param.js +42 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_js_and_css_inside_html.js +142 -0
- package/src/omega/core_plugins/inline/jsenv_plugin_new_inline_content.js +207 -0
- package/src/omega/core_plugins/leading_slash/jsenv_plugin_leading_slash.js +12 -0
- package/src/omega/core_plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js +77 -0
- package/src/omega/core_plugins/url_resolution/jsenv_plugin_url_resolution.js +28 -0
- package/src/omega/core_plugins/url_version/jsenv_plugin_url_version.js +50 -0
- package/src/omega/core_plugins.js +42 -0
- package/src/omega/errors.js +168 -0
- package/src/omega/file_url_converter.js +21 -0
- package/src/omega/kitchen.js +776 -0
- package/src/omega/omega_server.js +129 -0
- package/src/omega/plugin_controller.js +240 -0
- package/src/omega/runtime_support/default_runtime_support.js +13 -0
- package/src/omega/runtime_support/features_compatibility.js +130 -0
- package/src/omega/runtime_support/runtime_support.js +52 -0
- package/src/omega/server/file_service.js +155 -0
- package/src/omega/server/user_agent.js +22 -0
- package/src/omega/url_graph/url_graph_load.js +69 -0
- package/src/omega/url_graph/url_graph_report.js +151 -0
- package/src/omega/url_graph/url_graph_sort.js +29 -0
- package/src/omega/url_graph/url_info_transformations.js +161 -0
- package/src/omega/url_graph.js +133 -0
- package/src/omega/url_mentions/css_url_mentions.js +63 -0
- package/src/omega/url_mentions/html_url_mentions.js +185 -0
- package/src/omega/url_mentions/js_module_url_mentions.js +91 -0
- package/src/omega/url_mentions/parse_url_mentions.js +37 -0
- package/src/omega/url_mentions/worker_classic_url_mentions.js +37 -0
- package/src/{internal/executing → test}/execute_plan.js +156 -211
- package/src/{execute_test_plan.js → test/execute_test_plan.js} +36 -81
- package/src/{internal/executing → test}/execution_colors.js +0 -0
- package/src/{internal/executing → test}/execution_steps.js +2 -8
- package/src/{internal/executing → test}/gc.js +0 -0
- package/src/test/logs_file_execution.js +223 -0
- package/dist/browser_client/asset-manifest.json +0 -4
- package/dist/browser_client/browser_client_fb33eaa4.js +0 -5320
- package/dist/browser_client/browser_client_fb33eaa4.js.map +0 -1089
- package/dist/build_manifest.js +0 -12
- package/dist/compile_proxy/asset-manifest.json +0 -4
- package/dist/compile_proxy/compile_proxy.html__inline__20_651d1e7b.js.map +0 -343
- package/dist/compile_proxy/compile_proxy_62f952c4.html +0 -2245
- package/dist/event_source_client/asset-manifest.json +0 -4
- package/dist/event_source_client/event_source_client_69f48287.js +0 -354
- package/dist/event_source_client/event_source_client_69f48287.js.map +0 -128
- package/dist/redirector/asset-manifest.json +0 -4
- package/dist/redirector/redirector.html__inline__12_171e07b4.js.map +0 -349
- package/dist/redirector/redirector_8117ec92.html +0 -2290
- package/dist/toolbar/asset-manifest.json +0 -13
- package/dist/toolbar/assets/compilation.css_7421bd55.map +0 -12
- package/dist/toolbar/assets/eventsource.css_c0c71e7b.map +0 -12
- package/dist/toolbar/assets/execution.css_f3377c10.map +0 -12
- package/dist/toolbar/assets/focus.css_896f3e45.map +0 -12
- package/dist/toolbar/assets/light_theme.css_5bff0336.map +0 -12
- package/dist/toolbar/assets/overflow_menu.css_9a0fc3d8.map +0 -12
- package/dist/toolbar/assets/settings.css_942b5a9e.map +0 -12
- package/dist/toolbar/assets/toolbar_main.css_b1c67dd7.map +0 -28
- package/dist/toolbar/assets/tooltip.css_a94a8bdd.map +0 -12
- package/dist/toolbar/toolbar_b0c9100c.html +0 -4976
- package/dist/toolbar/toolbar_main_f54c1bb0.js.map +0 -776
- package/dist/toolbar_injector/asset-manifest.json +0 -5
- package/dist/toolbar_injector/assets/jsenv_logo_192011c2.svg +0 -95
- package/dist/toolbar_injector/toolbar_injector_65b501eb.js +0 -976
- package/dist/toolbar_injector/toolbar_injector_65b501eb.js.map +0 -294
- package/helpers/babel/AsyncGenerator/AsyncGenerator.js +0 -81
- package/helpers/babel/AwaitValue/AwaitValue.js +0 -3
- package/helpers/babel/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -33
- package/helpers/babel/arrayLikeToArray/arrayLikeToArray.js +0 -7
- package/helpers/babel/arrayWithHoles/arrayWithHoles.js +0 -4
- package/helpers/babel/arrayWithoutHoles/arrayWithoutHoles.js +0 -6
- package/helpers/babel/assertThisInitialized/assertThisInitialized.js +0 -7
- package/helpers/babel/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -40
- package/helpers/babel/asyncIterator/asyncIterator.js +0 -65
- package/helpers/babel/asyncToGenerator/asyncToGenerator.js +0 -34
- package/helpers/babel/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -5
- package/helpers/babel/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -20
- package/helpers/babel/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -6
- package/helpers/babel/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -13
- package/helpers/babel/classCallCheck/classCallCheck.js +0 -5
- package/helpers/babel/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -5
- package/helpers/babel/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -6
- package/helpers/babel/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -7
- package/helpers/babel/classNameTDZError/classNameTDZError.js +0 -4
- package/helpers/babel/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -7
- package/helpers/babel/classPrivateFieldGet/classPrivateFieldGet.js +0 -7
- package/helpers/babel/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -6
- package/helpers/babel/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -5
- package/helpers/babel/classPrivateFieldSet/classPrivateFieldSet.js +0 -8
- package/helpers/babel/classPrivateMethodGet/classPrivateMethodGet.js +0 -6
- package/helpers/babel/classPrivateMethodSet/classPrivateMethodSet.js +0 -3
- package/helpers/babel/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -9
- package/helpers/babel/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -15
- package/helpers/babel/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -6
- package/helpers/babel/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -3
- package/helpers/babel/construct/construct.js +0 -16
- package/helpers/babel/createClass/createClass.js +0 -15
- package/helpers/babel/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -60
- package/helpers/babel/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -23
- package/helpers/babel/createRawReactElement/createRawReactElement.js +0 -50
- package/helpers/babel/createSuper/createSuper.js +0 -22
- package/helpers/babel/decorate/decorate.js +0 -403
- package/helpers/babel/defaults/defaults.js +0 -11
- package/helpers/babel/defineEnumerableProperties/defineEnumerableProperties.js +0 -23
- package/helpers/babel/defineProperty/defineProperty.js +0 -18
- package/helpers/babel/extends/extends.js +0 -14
- package/helpers/babel/get/get.js +0 -19
- package/helpers/babel/getPrototypeOf/getPrototypeOf.js +0 -4
- package/helpers/babel/inherits/inherits.js +0 -19
- package/helpers/babel/inheritsLoose/inheritsLoose.js +0 -7
- package/helpers/babel/initializerDefineProperty/initializerDefineProperty.js +0 -10
- package/helpers/babel/initializerWarningHelper/initializerWarningHelper.js +0 -6
- package/helpers/babel/instanceof/instanceof.js +0 -6
- package/helpers/babel/interopRequireDefault/interopRequireDefault.js +0 -3
- package/helpers/babel/interopRequireWildcard/interopRequireWildcard.js +0 -37
- package/helpers/babel/isNativeFunction/isNativeFunction.js +0 -4
- package/helpers/babel/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -21
- package/helpers/babel/iterableToArray/iterableToArray.js +0 -7
- package/helpers/babel/iterableToArrayLimit/iterableToArrayLimit.js +0 -36
- package/helpers/babel/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -10
- package/helpers/babel/jsx/jsx.js +0 -50
- package/helpers/babel/maybeArrayLike/maybeArrayLike.js +0 -10
- package/helpers/babel/newArrowCheck/newArrowCheck.js +0 -5
- package/helpers/babel/nonIterableRest/nonIterableRest.js +0 -5
- package/helpers/babel/nonIterableSpread/nonIterableSpread.js +0 -5
- package/helpers/babel/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -3
- package/helpers/babel/objectSpread/objectSpread.js +0 -23
- package/helpers/babel/objectSpread2/objectSpread2.js +0 -41
- package/helpers/babel/objectWithoutProperties/objectWithoutProperties.js +0 -19
- package/helpers/babel/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -13
- package/helpers/babel/possibleConstructorReturn/possibleConstructorReturn.js +0 -10
- package/helpers/babel/readOnlyError/readOnlyError.js +0 -4
- package/helpers/babel/readme.md +0 -8
- package/helpers/babel/set/set.js +0 -44
- package/helpers/babel/setPrototypeOf/setPrototypeOf.js +0 -6
- package/helpers/babel/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -8
- package/helpers/babel/slicedToArray/slicedToArray.js +0 -10
- package/helpers/babel/slicedToArrayLoose/slicedToArrayLoose.js +0 -13
- package/helpers/babel/superPropBase/superPropBase.js +0 -10
- package/helpers/babel/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -10
- package/helpers/babel/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -7
- package/helpers/babel/tdz/tdz.js +0 -4
- package/helpers/babel/temporalRef/temporalRef.js +0 -6
- package/helpers/babel/temporalUndefined/temporalUndefined.js +0 -3
- package/helpers/babel/toArray/toArray.js +0 -10
- package/helpers/babel/toConsumableArray/toConsumableArray.js +0 -10
- package/helpers/babel/toPrimitive/toPrimitive.js +0 -10
- package/helpers/babel/toPropertyKey/toPropertyKey.js +0 -6
- package/helpers/babel/typeof/typeof.js +0 -14
- package/helpers/babel/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -12
- package/helpers/babel/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -8
- package/helpers/babel/wrapNativeSuper/wrapNativeSuper.js +0 -30
- package/helpers/babel/wrapRegExp/wrapRegExp.js +0 -63
- package/helpers/babel/writeOnlyError/writeOnlyError.js +0 -4
- package/helpers/import-meta/import-meta-url-commonjs.js +0 -9
- package/helpers/import-meta/import-meta-url-global.js +0 -54
- package/src/build_project.js +0 -336
- package/src/commonjs_to_js_module.js +0 -180
- package/src/dev_server.js +0 -302
- package/src/execute.js +0 -184
- package/src/import_using_child_process.js +0 -68
- package/src/internal/browser_client/browser_client.js +0 -220
- package/src/internal/browser_client/browser_client_factory.js +0 -144
- package/src/internal/browser_client/browser_error_stack_remap.js +0 -43
- package/src/internal/browser_client/browser_system.js +0 -216
- package/src/internal/browser_client/module_namespace_transfer.js +0 -90
- package/src/internal/browser_detection/browser_detection.js +0 -65
- package/src/internal/browser_detection/detect_android.js +0 -13
- package/src/internal/browser_detection/detect_chrome.js +0 -28
- package/src/internal/browser_detection/detect_edge.js +0 -13
- package/src/internal/browser_detection/detect_electron.js +0 -1
- package/src/internal/browser_detection/detect_firefox.js +0 -17
- package/src/internal/browser_detection/detect_internet_explorer.js +0 -14
- package/src/internal/browser_detection/detect_ios.js +0 -19
- package/src/internal/browser_detection/detect_opera.js +0 -27
- package/src/internal/browser_detection/detect_safari.js +0 -13
- package/src/internal/browser_detection/user_agent_data.js +0 -25
- package/src/internal/browser_detection/util.js +0 -13
- package/src/internal/browser_launcher/browser_runtime_profile.js +0 -81
- package/src/internal/browser_launcher/execute_html_file.js +0 -355
- package/src/internal/browser_launcher/from_playwright.js +0 -320
- package/src/internal/browser_launcher/page_errors_and_logs.js +0 -77
- package/src/internal/browser_utils/fetch_and_eval.js +0 -27
- package/src/internal/browser_utils/fetch_and_eval_using_script.js +0 -47
- package/src/internal/browser_utils/fetch_browser.js +0 -34
- package/src/internal/browser_utils/fetch_json.js +0 -7
- package/src/internal/building/build_logs.js +0 -134
- package/src/internal/building/build_stats.js +0 -100
- package/src/internal/building/build_url_generator.js +0 -153
- package/src/internal/building/build_using_rollup.js +0 -359
- package/src/internal/building/css/apply_post_css.js +0 -55
- package/src/internal/building/css/jsenv_parse_css.js +0 -260
- package/src/internal/building/css/move_css_urls.js +0 -44
- package/src/internal/building/css/parse_css_urls.js +0 -38
- package/src/internal/building/css/postcss_plugin_url_visitor.js +0 -245
- package/src/internal/building/css/replace_css_urls.js +0 -68
- package/src/internal/building/global_format/es_to_system.js +0 -34
- package/src/internal/building/html/html_node_mutations.js +0 -29
- package/src/internal/building/html/html_scan.js +0 -70
- package/src/internal/building/html/jsenv_parse_html.js +0 -813
- package/src/internal/building/html/minify_html.js +0 -7
- package/src/internal/building/import_assertions/css_module.js +0 -43
- package/src/internal/building/import_references.js +0 -80
- package/src/internal/building/importmap/jsenv_parse_importmap.js +0 -28
- package/src/internal/building/js/babel_plugin_inline_worker_imports.js +0 -96
- package/src/internal/building/js/jsenv_parse_js.js +0 -122
- package/src/internal/building/js/minify_js.js +0 -33
- package/src/internal/building/js/transform_worker.js +0 -55
- package/src/internal/building/json/jsenv_parse_json.js +0 -11
- package/src/internal/building/parse_ressource.js +0 -207
- package/src/internal/building/ressource_builder.js +0 -1098
- package/src/internal/building/ressource_builder_util.js +0 -194
- package/src/internal/building/rollup_plugin_jsenv.js +0 -1965
- package/src/internal/building/sort_pathnames.js +0 -10
- package/src/internal/building/sourcemap/sourcemap_loader.js +0 -70
- package/src/internal/building/svg/jsenv_parse_svg.js +0 -112
- package/src/internal/building/url_fetcher.js +0 -85
- package/src/internal/building/url_loader.js +0 -127
- package/src/internal/building/url_trace.js +0 -229
- package/src/internal/building/url_versioning/resolve_import_url_helper.js +0 -12
- package/src/internal/building/url_versioning/url_versioning.js +0 -65
- package/src/internal/building/webmanifest/jsenv_parse_webmanifest.js +0 -48
- package/src/internal/compile_server/commonjs/rollup_plugin_commonjs_named_exports.js +0 -187
- package/src/internal/compile_server/compile_file.js +0 -273
- package/src/internal/compile_server/compile_server.js +0 -519
- package/src/internal/compile_server/compiled_file_service.js +0 -264
- package/src/internal/compile_server/html/html_ast.js +0 -534
- package/src/internal/compile_server/html/html_source_file_service.js +0 -453
- package/src/internal/compile_server/html/jsenv_compile_html.js +0 -674
- package/src/internal/compile_server/importmap/jsenv_compile_importmap.js +0 -28
- package/src/internal/compile_server/js/ansi_to_html.js +0 -9
- package/src/internal/compile_server/js/babelHelper.js +0 -145
- package/src/internal/compile_server/js/babel_parse_error.js +0 -9
- package/src/internal/compile_server/js/babel_plugin_global_this_as_jsenv_import.js +0 -34
- package/src/internal/compile_server/js/babel_plugin_import_assertions.js +0 -121
- package/src/internal/compile_server/js/babel_plugin_import_metadata.js +0 -18
- package/src/internal/compile_server/js/babel_plugin_import_visitor.js +0 -84
- package/src/internal/compile_server/js/babel_plugin_new_stylesheet_as_jsenv_import.js +0 -113
- package/src/internal/compile_server/js/babel_plugin_proxy_external_imports.js +0 -31
- package/src/internal/compile_server/js/babel_plugin_regenerator_runtime_as_jsenv_import.js +0 -48
- package/src/internal/compile_server/js/babel_plugin_replace_expressions.js +0 -101
- package/src/internal/compile_server/js/babel_plugin_systemjs_prepend.js +0 -23
- package/src/internal/compile_server/js/babel_plugin_transform_import_meta.js +0 -134
- package/src/internal/compile_server/js/babel_plugins.js +0 -37
- package/src/internal/compile_server/js/generateBabelHelper.js +0 -36
- package/src/internal/compile_server/js/js_transformer.js +0 -195
- package/src/internal/compile_server/js/jsenv_compile_js.js +0 -62
- package/src/internal/compile_server/js/load_babel_plugin_map_from_file.js +0 -49
- package/src/internal/compile_server/jsenv_directory/comparison_utils.js +0 -27
- package/src/internal/compile_server/jsenv_directory/compilation_result.js +0 -243
- package/src/internal/compile_server/jsenv_directory/compilation_result_from_build.js +0 -184
- package/src/internal/compile_server/jsenv_directory/compile_asset.js +0 -24
- package/src/internal/compile_server/jsenv_directory/compile_context.js +0 -60
- package/src/internal/compile_server/jsenv_directory/compile_profile.js +0 -217
- package/src/internal/compile_server/jsenv_directory/file_lock_registry.js +0 -24
- package/src/internal/compile_server/jsenv_directory/file_lock_registry.test.js +0 -47
- package/src/internal/compile_server/jsenv_directory/fs_optimized_for_cache.js +0 -57
- package/src/internal/compile_server/jsenv_directory/jsenv_directory.js +0 -183
- package/src/internal/compile_server/jsenv_directory/reuse_or_create_compiled_file.js +0 -269
- package/src/internal/compile_server/jsenv_directory/update_compile_cache.js +0 -131
- package/src/internal/compile_server/jsenv_directory/validate_compile_cache.js +0 -264
- package/src/internal/compile_server/sse_service/sse_service.js +0 -369
- package/src/internal/coverage/babel_plugin_instrument.js +0 -90
- package/src/internal/coverage/coverage_reporter_html_directory.js +0 -37
- package/src/internal/coverage/coverage_reporter_json_file.js +0 -22
- package/src/internal/coverage/coverage_reporter_text_log.js +0 -20
- package/src/internal/coverage/empty_coverage_factory.js +0 -70
- package/src/internal/coverage/file_by_file_coverage.js +0 -28
- package/src/internal/coverage/istanbul_coverage_composition.js +0 -28
- package/src/internal/coverage/istanbul_coverage_map_from_coverage.js +0 -16
- package/src/internal/coverage/list_files_not_covered.js +0 -20
- package/src/internal/coverage/missing_coverage.js +0 -46
- package/src/internal/coverage/report_to_coverage.js +0 -198
- package/src/internal/coverage/v8_and_istanbul.js +0 -38
- package/src/internal/coverage/v8_coverage_composition.js +0 -23
- package/src/internal/coverage/v8_coverage_from_directory.js +0 -86
- package/src/internal/coverage/v8_coverage_to_istanbul.js +0 -100
- package/src/internal/data_url.js +0 -54
- package/src/internal/dev_server/event_source_client/event_source_client.js +0 -63
- package/src/internal/dev_server/event_source_client/file_changes.js +0 -82
- package/src/internal/dev_server/event_source_client/livereload_preference.js +0 -13
- package/src/internal/dev_server/exploring/exploring.css +0 -237
- package/src/internal/dev_server/exploring/exploring.html +0 -79
- package/src/internal/dev_server/exploring/exploring.js +0 -243
- package/src/internal/dev_server/exploring/fetch_exploring_json.js +0 -19
- package/src/internal/dev_server/toolbar/compilation/compilation.css +0 -23
- package/src/internal/dev_server/toolbar/compilation/toolbar_compilation.js +0 -202
- package/src/internal/dev_server/toolbar/eventsource/toolbar_eventsource.js +0 -83
- package/src/internal/dev_server/toolbar/execution/toolbar_execution.js +0 -91
- package/src/internal/error_stack_remap/install_error_stack_remapping.js +0 -142
- package/src/internal/error_stack_remap/remap_call_site.js +0 -315
- package/src/internal/error_stack_remap/remap_stack.js +0 -218
- package/src/internal/error_stack_remap/stringify_stack.js +0 -9
- package/src/internal/executing/launch_and_execute.js +0 -458
- package/src/internal/executing/logs_file_execution.js +0 -160
- package/src/internal/executing/logs_plan_summary.js +0 -144
- package/src/internal/features/browser_feature_detection/browser_feature_detect_dynamic_import.js +0 -20
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_css.js +0 -23
- package/src/internal/features/browser_feature_detection/browser_feature_detect_import_assertions_json.js +0 -25
- package/src/internal/features/browser_feature_detection/browser_feature_detect_importmap.js +0 -37
- package/src/internal/features/browser_feature_detection/browser_feature_detect_new_stylesheet.js +0 -9
- package/src/internal/features/browser_feature_detection/browser_feature_detect_top_level_await.js +0 -14
- package/src/internal/features/browser_feature_detection/browser_feature_detection.js +0 -89
- package/src/internal/features/browser_feature_detection/compile_proxy.html +0 -27
- package/src/internal/features/browser_feature_detection/execute_with_script_module.js +0 -24
- package/src/internal/features/features_compat_from_runtime.js +0 -38
- package/src/internal/features/features_compat_from_runtime_support.js +0 -31
- package/src/internal/features/features_compatibility.js +0 -37
- package/src/internal/features/node_feature_detection/feature_detect_dynamic_import.mjs +0 -5
- package/src/internal/features/node_feature_detection/feature_detect_top_level_await.mjs +0 -1
- package/src/internal/features/node_feature_detection/node_feature_detect_dynamic_import.js +0 -5
- package/src/internal/features/node_feature_detection/node_feature_detect_top_level_await.js +0 -16
- package/src/internal/features/node_feature_detection/node_feature_detection.js +0 -66
- package/src/internal/fetching.js +0 -28
- package/src/internal/import_resolution/default_extension.js +0 -40
- package/src/internal/import_resolution/import_resolver_importmap.js +0 -64
- package/src/internal/import_resolution/import_resolver_node.js +0 -254
- package/src/internal/import_resolution/importmap_default.js +0 -37
- package/src/internal/jsenv_builds.js +0 -19
- package/src/internal/jsenv_params_assertions.js +0 -12
- package/src/internal/jsenv_remote_directory.js +0 -156
- package/src/internal/logs/byte.js +0 -10
- package/src/internal/logs/byte_as_file_size.js +0 -9
- package/src/internal/logs/ms_as_duration.js +0 -12
- package/src/internal/memoize.js +0 -24
- package/src/internal/node_launcher/eval_source.js +0 -6
- package/src/internal/node_launcher/fetch_source.js +0 -8
- package/src/internal/node_launcher/node_error_stack_remap.js +0 -22
- package/src/internal/node_launcher/node_execution_dynamic_import.js +0 -75
- package/src/internal/node_launcher/node_execution_performance.js +0 -67
- package/src/internal/node_launcher/node_execution_systemjs.js +0 -125
- package/src/internal/node_launcher/node_runtime_report.js +0 -77
- package/src/internal/node_launcher/node_system.js +0 -192
- package/src/internal/node_launcher/perf_node.js +0 -13
- package/src/internal/node_launcher/process_options.js +0 -46
- package/src/internal/node_launcher/value_install.js +0 -14
- package/src/internal/origin_directory_converter.js +0 -62
- package/src/internal/promise_race.js +0 -19
- package/src/internal/redirector/redirector.html +0 -40
- package/src/internal/regexp_escape.js +0 -34
- package/src/internal/require.js +0 -3
- package/src/internal/response_validation.js +0 -130
- package/src/internal/runtime_client/module_registration.js +0 -207
- package/src/internal/runtime_client/s.js +0 -864
- package/src/internal/runtime_client/s.js.md +0 -1
- package/src/internal/runtime_support/jsenv_runtime_support.js +0 -15
- package/src/internal/runtime_support/runtime_support.js +0 -70
- package/src/internal/semantic_versioning/compare_versions.js +0 -28
- package/src/internal/semantic_versioning/highest_version.js +0 -11
- package/src/internal/semantic_versioning/is_above.js +0 -5
- package/src/internal/semantic_versioning/is_below.js +0 -5
- package/src/internal/semantic_versioning/is_equal.js +0 -3
- package/src/internal/semantic_versioning/lowest_version.js +0 -11
- package/src/internal/semantic_versioning/version_from_value.js +0 -42
- package/src/internal/sourcemap_utils.js +0 -112
- package/src/internal/template_string_escape.js +0 -20
- package/src/internal/url_conversion.js +0 -313
- package/src/internal/url_utils.js +0 -33
- package/src/internal/url_utils.test.js +0 -39
- package/src/internal/windows_file_path_utils.js +0 -16
- package/src/jsenv_file_urls.js +0 -35
- package/src/jsenv_service_worker_finalizer.js +0 -55
- package/src/json_to_js_module.js +0 -13
- package/src/node_runtime.js +0 -227
- package/src/require_using_child_process.js +0 -67
- package/src/text_to_js_module.js +0 -13
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { DataUrl } from "@jsenv/utils/urls/data_url.js"
|
|
2
|
+
import { ContentType } from "@jsenv/utils/src/content_type.js"
|
|
3
|
+
|
|
4
|
+
export const jsenvPluginDataUrls = () => {
|
|
5
|
+
return {
|
|
6
|
+
name: "jsenv:data_urls",
|
|
7
|
+
appliesDuring: "*",
|
|
8
|
+
resolve: ({ specifier }) => {
|
|
9
|
+
if (!specifier.startsWith("data:")) {
|
|
10
|
+
return null
|
|
11
|
+
}
|
|
12
|
+
return specifier
|
|
13
|
+
},
|
|
14
|
+
load: ({ url, data }) => {
|
|
15
|
+
if (!url.startsWith("data:")) {
|
|
16
|
+
return null
|
|
17
|
+
}
|
|
18
|
+
const { contentType, base64Flag, data: urlData } = DataUrl.parse(url)
|
|
19
|
+
data.base64Flag = base64Flag
|
|
20
|
+
return {
|
|
21
|
+
contentType,
|
|
22
|
+
content: contentFromUrlData({ contentType, base64Flag, urlData }),
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
formatReferencedUrl: (reference, { urlGraph, cook }) => {
|
|
26
|
+
if (!reference.url.startsWith("data:")) {
|
|
27
|
+
return null
|
|
28
|
+
}
|
|
29
|
+
if (reference.type === "sourcemap_comment") {
|
|
30
|
+
return null
|
|
31
|
+
}
|
|
32
|
+
return (async () => {
|
|
33
|
+
const urlInfo = urlGraph.getUrlInfo(reference.url)
|
|
34
|
+
await cook({
|
|
35
|
+
reference,
|
|
36
|
+
urlInfo,
|
|
37
|
+
})
|
|
38
|
+
if (urlInfo.originalContent === urlInfo.content) {
|
|
39
|
+
return reference.url
|
|
40
|
+
}
|
|
41
|
+
const specifier = DataUrl.stringify({
|
|
42
|
+
contentType: urlInfo.contentType,
|
|
43
|
+
base64Flag: urlInfo.data.base64Flag,
|
|
44
|
+
data: urlInfo.data.base64Flag
|
|
45
|
+
? dataToBase64(urlInfo.content)
|
|
46
|
+
: String(urlInfo.content),
|
|
47
|
+
})
|
|
48
|
+
return specifier
|
|
49
|
+
})()
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const contentFromUrlData = ({ contentType, base64Flag, urlData }) => {
|
|
55
|
+
if (ContentType.isTextual(contentType)) {
|
|
56
|
+
if (base64Flag) {
|
|
57
|
+
return base64ToString(urlData)
|
|
58
|
+
}
|
|
59
|
+
return urlData
|
|
60
|
+
}
|
|
61
|
+
if (base64Flag) {
|
|
62
|
+
return base64ToBuffer(urlData)
|
|
63
|
+
}
|
|
64
|
+
return Buffer.from(urlData)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const base64ToBuffer = (base64String) => Buffer.from(base64String, "base64")
|
|
68
|
+
const base64ToString = (base64String) =>
|
|
69
|
+
Buffer.from(base64String, "base64").toString("utf8")
|
|
70
|
+
const dataToBase64 = (data) => Buffer.from(data).toString("base64")
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsenvPluginJsAndCssInsideHtml } from "./jsenv_plugin_js_and_css_inside_html.js"
|
|
2
|
+
import { jsenvPluginNewInlineContent } from "./jsenv_plugin_new_inline_content.js"
|
|
3
|
+
import { jsenvPluginDataUrls } from "./jsenv_plugin_data_urls.js"
|
|
4
|
+
import { jsenvPluginInlineQueryParam } from "./jsenv_plugin_inline_query_param.js"
|
|
5
|
+
|
|
6
|
+
export const jsenvPluginInline = ({ allowEscapeForVersioning } = {}) => {
|
|
7
|
+
return [
|
|
8
|
+
jsenvPluginJsAndCssInsideHtml(),
|
|
9
|
+
jsenvPluginNewInlineContent({ allowEscapeForVersioning }),
|
|
10
|
+
jsenvPluginDataUrls(),
|
|
11
|
+
jsenvPluginInlineQueryParam(),
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DataUrl } from "@jsenv/utils/urls/data_url.js"
|
|
2
|
+
|
|
3
|
+
export const jsenvPluginInlineQueryParam = () => {
|
|
4
|
+
return {
|
|
5
|
+
name: "jsenv:inline_query_param",
|
|
6
|
+
appliesDuring: "*",
|
|
7
|
+
formatReferencedUrl: {
|
|
8
|
+
// <link> and <script> can be inlined in the html
|
|
9
|
+
// this should be done during dev and postbuild but not build
|
|
10
|
+
// so that the bundled file gets inlined and not the entry point
|
|
11
|
+
"link_href": () => null,
|
|
12
|
+
"script_src": () => null,
|
|
13
|
+
// if the referenced url is a worker we could use
|
|
14
|
+
// https://www.oreilly.com/library/view/web-workers/9781449322120/ch04.html
|
|
15
|
+
// but maybe we should rather use ?object_url
|
|
16
|
+
// or people could do this:
|
|
17
|
+
// import workerText from './worker.js?text'
|
|
18
|
+
// const blob = new Blob(workerText, { type: 'application/javascript' })
|
|
19
|
+
// window.URL.createObjectURL(blob)
|
|
20
|
+
// in any case the recommended way is to use an url
|
|
21
|
+
// to benefit from shared worker and reuse worker between tabs
|
|
22
|
+
"*": (reference, { urlGraph, cook }) => {
|
|
23
|
+
if (!new URL(reference.url).searchParams.has("inline")) {
|
|
24
|
+
return null
|
|
25
|
+
}
|
|
26
|
+
return (async () => {
|
|
27
|
+
const urlInfo = urlGraph.getUrlInfo(reference.url)
|
|
28
|
+
await cook({
|
|
29
|
+
reference,
|
|
30
|
+
urlInfo,
|
|
31
|
+
})
|
|
32
|
+
const specifier = DataUrl.stringify({
|
|
33
|
+
mediaType: urlInfo.contentType,
|
|
34
|
+
base64Flag: true,
|
|
35
|
+
data: Buffer.from(urlInfo.content).toString("base64"),
|
|
36
|
+
})
|
|
37
|
+
return specifier
|
|
38
|
+
})()
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseHtmlString,
|
|
3
|
+
stringifyHtmlAst,
|
|
4
|
+
visitHtmlAst,
|
|
5
|
+
getHtmlNodeTextNode,
|
|
6
|
+
htmlNodePosition,
|
|
7
|
+
parseScriptNode,
|
|
8
|
+
setHtmlNodeText,
|
|
9
|
+
getHtmlNodeAttributeByName,
|
|
10
|
+
} from "@jsenv/utils/html_ast/html_ast.js"
|
|
11
|
+
import { injectQueryParams } from "@jsenv/utils/urls/url_utils.js"
|
|
12
|
+
import { generateInlineContentUrl } from "@jsenv/utils/urls/inline_content_url_generator.js"
|
|
13
|
+
|
|
14
|
+
export const jsenvPluginJsAndCssInsideHtml = () => {
|
|
15
|
+
return {
|
|
16
|
+
name: "jsenv:js_and_css_inside_html",
|
|
17
|
+
appliesDuring: "*",
|
|
18
|
+
transform: {
|
|
19
|
+
html: async ({ url, content }, { cook, referenceUtils }) => {
|
|
20
|
+
const htmlAst = parseHtmlString(content)
|
|
21
|
+
const actions = []
|
|
22
|
+
const handleInlineStyle = (node) => {
|
|
23
|
+
if (node.nodeName !== "style") {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
const textNode = getHtmlNodeTextNode(node)
|
|
27
|
+
if (!textNode) {
|
|
28
|
+
return
|
|
29
|
+
}
|
|
30
|
+
actions.push(async () => {
|
|
31
|
+
const { line, column, lineEnd, columnEnd, isOriginal } =
|
|
32
|
+
htmlNodePosition.readNodePosition(node, {
|
|
33
|
+
preferOriginal: true,
|
|
34
|
+
})
|
|
35
|
+
const inlineStyleUrl = generateInlineContentUrl({
|
|
36
|
+
url,
|
|
37
|
+
extension: ".css",
|
|
38
|
+
line,
|
|
39
|
+
column,
|
|
40
|
+
lineEnd,
|
|
41
|
+
columnEnd,
|
|
42
|
+
})
|
|
43
|
+
const [inlineStyleReference, inlineStyleUrlInfo] =
|
|
44
|
+
referenceUtils.foundInline({
|
|
45
|
+
type: "link_href",
|
|
46
|
+
// we remove 1 to the line because imagine the following html:
|
|
47
|
+
// <style>body { color: red; }</style>
|
|
48
|
+
// -> content starts same line as <style>
|
|
49
|
+
line: line - 1,
|
|
50
|
+
column,
|
|
51
|
+
isOriginal,
|
|
52
|
+
specifier: inlineStyleUrl,
|
|
53
|
+
contentType: "text/css",
|
|
54
|
+
content: textNode.value,
|
|
55
|
+
})
|
|
56
|
+
await cook({
|
|
57
|
+
reference: inlineStyleReference,
|
|
58
|
+
urlInfo: inlineStyleUrlInfo,
|
|
59
|
+
})
|
|
60
|
+
setHtmlNodeText(node, inlineStyleUrlInfo.content)
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
const handleInlineScript = (node) => {
|
|
64
|
+
if (node.nodeName !== "script") {
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
const textNode = getHtmlNodeTextNode(node)
|
|
68
|
+
if (!textNode) {
|
|
69
|
+
return
|
|
70
|
+
}
|
|
71
|
+
const contentSrc = getHtmlNodeAttributeByName(node, "content-src")
|
|
72
|
+
if (contentSrc) {
|
|
73
|
+
// it's inline but there is a corresponding "src" somewhere
|
|
74
|
+
// - for instance the importmap was inlined by importmap plugin
|
|
75
|
+
// in that case the content is already cooked and can be kept as it is
|
|
76
|
+
// - any other logic that would turn a remote script into some content
|
|
77
|
+
// but don't want to cook the content
|
|
78
|
+
return
|
|
79
|
+
}
|
|
80
|
+
actions.push(async () => {
|
|
81
|
+
const scriptCategory = parseScriptNode(node)
|
|
82
|
+
const { line, column, lineEnd, columnEnd, isOriginal } =
|
|
83
|
+
htmlNodePosition.readNodePosition(node, {
|
|
84
|
+
preferOriginal: true,
|
|
85
|
+
})
|
|
86
|
+
let inlineScriptUrl = generateInlineContentUrl({
|
|
87
|
+
url,
|
|
88
|
+
extension: scriptCategory === "importmap" ? ".importmap" : ".js",
|
|
89
|
+
line,
|
|
90
|
+
column,
|
|
91
|
+
lineEnd,
|
|
92
|
+
columnEnd,
|
|
93
|
+
})
|
|
94
|
+
if (scriptCategory === "classic") {
|
|
95
|
+
inlineScriptUrl = injectQueryParams(inlineScriptUrl, {
|
|
96
|
+
js_classic: "",
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
const [inlineScriptReference, inlineScriptUrlInfo] =
|
|
100
|
+
referenceUtils.foundInline({
|
|
101
|
+
node,
|
|
102
|
+
type: "script_src",
|
|
103
|
+
// we remove 1 to the line because imagine the following html:
|
|
104
|
+
// <script>console.log('ok')</script>
|
|
105
|
+
// -> content starts same line as <script>
|
|
106
|
+
line: line - 1,
|
|
107
|
+
column,
|
|
108
|
+
isOriginal,
|
|
109
|
+
specifier: inlineScriptUrl,
|
|
110
|
+
contentType:
|
|
111
|
+
scriptCategory === "importmap"
|
|
112
|
+
? "application/importmap+json"
|
|
113
|
+
: "application/javascript",
|
|
114
|
+
content: textNode.value,
|
|
115
|
+
})
|
|
116
|
+
await cook({
|
|
117
|
+
reference: inlineScriptReference,
|
|
118
|
+
urlInfo: inlineScriptUrlInfo,
|
|
119
|
+
})
|
|
120
|
+
setHtmlNodeText(node, inlineScriptUrlInfo.content)
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
visitHtmlAst(htmlAst, (node) => {
|
|
124
|
+
handleInlineStyle(node)
|
|
125
|
+
handleInlineScript(node)
|
|
126
|
+
})
|
|
127
|
+
if (actions.length === 0) {
|
|
128
|
+
return null
|
|
129
|
+
}
|
|
130
|
+
await Promise.all(
|
|
131
|
+
actions.map(async (action) => {
|
|
132
|
+
await action()
|
|
133
|
+
}),
|
|
134
|
+
)
|
|
135
|
+
const htmlModified = stringifyHtmlAst(htmlAst)
|
|
136
|
+
return {
|
|
137
|
+
content: htmlModified,
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Needs to be updated so that it sill works in the following cases:
|
|
3
|
+
* - templates literals transformed to regular stuff by babel
|
|
4
|
+
* - tagged name renamed by rollup
|
|
5
|
+
* - the template named is minified by terser
|
|
6
|
+
* In the cases above I must remain capable to recoginize the template literal
|
|
7
|
+
* to be able to update the urls inside (and even version the urls)
|
|
8
|
+
* because url versioning happens after minification it can be challenging
|
|
9
|
+
*
|
|
10
|
+
* TODO: use "keep_classnames" https://github.com/terser/terser#compress-options
|
|
11
|
+
* so that new InlineContent can be recognized after minification
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { createMagicSource } from "@jsenv/utils/sourcemap/magic_source.js"
|
|
15
|
+
import { JS_QUOTES } from "@jsenv/utils/string/js_quotes.js"
|
|
16
|
+
import { applyBabelPlugins } from "@jsenv/utils/js_ast/apply_babel_plugins.js"
|
|
17
|
+
import { generateInlineContentUrl } from "@jsenv/utils/urls/inline_content_url_generator.js"
|
|
18
|
+
|
|
19
|
+
export const jsenvPluginNewInlineContent = ({ allowEscapeForVersioning }) => {
|
|
20
|
+
return {
|
|
21
|
+
name: "jsenv:new_inline_content",
|
|
22
|
+
appliesDuring: "*",
|
|
23
|
+
transform: {
|
|
24
|
+
js_module: async (
|
|
25
|
+
{ url, generatedUrl, content, originalContent },
|
|
26
|
+
{ referenceUtils, cook, isSupportedOnRuntime },
|
|
27
|
+
) => {
|
|
28
|
+
const { metadata } = await applyBabelPlugins({
|
|
29
|
+
babelPlugins: [babelPluginMetadataInlineContentCalls],
|
|
30
|
+
url,
|
|
31
|
+
generatedUrl,
|
|
32
|
+
content,
|
|
33
|
+
})
|
|
34
|
+
const { inlineContentCalls } = metadata
|
|
35
|
+
if (inlineContentCalls.length === 0) {
|
|
36
|
+
return null
|
|
37
|
+
}
|
|
38
|
+
const magicSource = createMagicSource(content)
|
|
39
|
+
await inlineContentCalls.reduce(async (previous, inlineContentCall) => {
|
|
40
|
+
await previous
|
|
41
|
+
const inlineUrl = generateInlineContentUrl({
|
|
42
|
+
url,
|
|
43
|
+
extension: {
|
|
44
|
+
"application/json": ".json",
|
|
45
|
+
"text/css": ".css",
|
|
46
|
+
"text/plain": ".txt",
|
|
47
|
+
"application/octet-stream": "",
|
|
48
|
+
}[inlineContentCall.contentType],
|
|
49
|
+
line: inlineContentCall.line,
|
|
50
|
+
column: inlineContentCall.column,
|
|
51
|
+
lineEnd: inlineContentCall.lineEnd,
|
|
52
|
+
columnEnd: inlineContentCall.columnEnd,
|
|
53
|
+
})
|
|
54
|
+
let { quote } = inlineContentCall
|
|
55
|
+
if (quote === "`" && !isSupportedOnRuntime("template_literals")) {
|
|
56
|
+
// if quote is "`" and template literals are not supported
|
|
57
|
+
// we'll use a regular string (single or double quote)
|
|
58
|
+
// when rendering the string
|
|
59
|
+
quote = JS_QUOTES.pickBest(inlineContentCall.content)
|
|
60
|
+
}
|
|
61
|
+
const [inlineReference, inlineUrlInfo] = referenceUtils.foundInline({
|
|
62
|
+
type: "js_inline_content",
|
|
63
|
+
isOriginal: content === originalContent,
|
|
64
|
+
line: inlineContentCall.line,
|
|
65
|
+
column: inlineContentCall.column,
|
|
66
|
+
specifier: inlineUrl,
|
|
67
|
+
contentType: inlineContentCall.contentType,
|
|
68
|
+
content: inlineContentCall.content,
|
|
69
|
+
})
|
|
70
|
+
inlineUrlInfo.jsQuote = quote
|
|
71
|
+
inlineReference.escape = (value) =>
|
|
72
|
+
JS_QUOTES.escapeSpecialChars(value.slice(1, -1), { quote })
|
|
73
|
+
await cook({
|
|
74
|
+
reference: inlineReference,
|
|
75
|
+
urlInfo: inlineUrlInfo,
|
|
76
|
+
})
|
|
77
|
+
magicSource.replace({
|
|
78
|
+
start: inlineContentCall.start,
|
|
79
|
+
end: inlineContentCall.end,
|
|
80
|
+
replacement: JS_QUOTES.escapeSpecialChars(inlineUrlInfo.content, {
|
|
81
|
+
quote,
|
|
82
|
+
allowEscapeForVersioning,
|
|
83
|
+
}),
|
|
84
|
+
})
|
|
85
|
+
}, Promise.resolve())
|
|
86
|
+
return magicSource.toContentAndSourcemap()
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const babelPluginMetadataInlineContentCalls = () => {
|
|
93
|
+
return {
|
|
94
|
+
name: "metadata-inline-content-calls",
|
|
95
|
+
visitor: {
|
|
96
|
+
Program: (programPath, state) => {
|
|
97
|
+
const inlineContentCalls = []
|
|
98
|
+
programPath.traverse({
|
|
99
|
+
NewExpression: (path) => {
|
|
100
|
+
const newInlineContentCall = parseAsNewInlineContentCall(path)
|
|
101
|
+
if (newInlineContentCall) {
|
|
102
|
+
inlineContentCalls.push(newInlineContentCall)
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
state.file.metadata.inlineContentCalls = inlineContentCalls
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const parseAsNewInlineContentCall = (path) => {
|
|
113
|
+
const node = path.node
|
|
114
|
+
if (node.callee.type === "Identifier") {
|
|
115
|
+
// terser rename import to use a shorter name
|
|
116
|
+
const name = getOriginalName(path, node.callee.name)
|
|
117
|
+
if (name !== "InlineContent") {
|
|
118
|
+
return null
|
|
119
|
+
}
|
|
120
|
+
} else if (node.callee.id) {
|
|
121
|
+
// terser might combine new InlineContent('') declaration and usage
|
|
122
|
+
if (node.callee.id.type !== "Identifier") {
|
|
123
|
+
return null
|
|
124
|
+
}
|
|
125
|
+
const name = getOriginalName(path, node.callee.id.name)
|
|
126
|
+
if (name !== "InlineContent") {
|
|
127
|
+
return null
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (node.arguments.length !== 2) {
|
|
131
|
+
return null
|
|
132
|
+
}
|
|
133
|
+
const [firstArg, secondArg] = node.arguments
|
|
134
|
+
if (secondArg.type !== "ObjectExpression") {
|
|
135
|
+
return null
|
|
136
|
+
}
|
|
137
|
+
const typePropertyNode = secondArg.properties.find((property) => {
|
|
138
|
+
return (
|
|
139
|
+
property.key.type === "Identifier" &&
|
|
140
|
+
property.key.name === "type" &&
|
|
141
|
+
property.type === "ObjectProperty" &&
|
|
142
|
+
property.value.type === "StringLiteral"
|
|
143
|
+
)
|
|
144
|
+
})
|
|
145
|
+
if (!typePropertyNode) {
|
|
146
|
+
return null
|
|
147
|
+
}
|
|
148
|
+
const type = typePropertyNode.value.value
|
|
149
|
+
if (firstArg.type === "StringLiteral") {
|
|
150
|
+
const position = getNodePosition(firstArg)
|
|
151
|
+
return {
|
|
152
|
+
nodeType: "StringLiteral",
|
|
153
|
+
quote: firstArg.extra.raw[0],
|
|
154
|
+
contentType: type,
|
|
155
|
+
content: firstArg.value,
|
|
156
|
+
...position,
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (firstArg.type === "TemplateLiteral") {
|
|
160
|
+
const quasis = firstArg.quasis
|
|
161
|
+
if (quasis.length !== 1) {
|
|
162
|
+
return null
|
|
163
|
+
}
|
|
164
|
+
const templateElementNode = quasis[0]
|
|
165
|
+
const position = getNodePosition(firstArg)
|
|
166
|
+
return {
|
|
167
|
+
nodeType: "TemplateLiteral",
|
|
168
|
+
quote: "`",
|
|
169
|
+
contentType: type,
|
|
170
|
+
content: templateElementNode.value.cooked,
|
|
171
|
+
...position,
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return null
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const getNodePosition = (node) => {
|
|
178
|
+
return {
|
|
179
|
+
start: node.start,
|
|
180
|
+
end: node.end,
|
|
181
|
+
line: node.loc.start.line,
|
|
182
|
+
column: node.loc.start.column,
|
|
183
|
+
lineEnd: node.loc.end.line,
|
|
184
|
+
columnEnd: node.loc.end.column,
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const getOriginalName = (path, name) => {
|
|
189
|
+
const binding = path.scope.getBinding(name)
|
|
190
|
+
if (!binding) {
|
|
191
|
+
return name
|
|
192
|
+
}
|
|
193
|
+
if (binding.path.type === "ImportSpecifier") {
|
|
194
|
+
const importedName = binding.path.node.imported.name
|
|
195
|
+
if (name === importedName) {
|
|
196
|
+
return name
|
|
197
|
+
}
|
|
198
|
+
return getOriginalName(path, importedName)
|
|
199
|
+
}
|
|
200
|
+
if (binding.path.type === "VariableDeclarator") {
|
|
201
|
+
if (binding.path.node.init.type === "Identifier") {
|
|
202
|
+
const previousName = binding.path.node.init.name
|
|
203
|
+
return getOriginalName(path, previousName)
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
return name
|
|
207
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const jsenvPluginLeadingSlash = () => {
|
|
2
|
+
return {
|
|
3
|
+
name: "jsenv:leading_slash",
|
|
4
|
+
appliesDuring: "*",
|
|
5
|
+
resolve: ({ specifier }, { rootDirectoryUrl }) => {
|
|
6
|
+
if (specifier[0] !== "/") {
|
|
7
|
+
return null
|
|
8
|
+
}
|
|
9
|
+
return new URL(specifier.slice(1), rootDirectoryUrl).href
|
|
10
|
+
},
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* - should I restore eventual search params lost during node esm resolution
|
|
3
|
+
* - what about symlinks?
|
|
4
|
+
* It feels like I should apply symlink (when we don't want to preserve them)
|
|
5
|
+
* once a file:/// url is found, regardless
|
|
6
|
+
* if that comes from node resolution or anything else (not even magic resolution)
|
|
7
|
+
* it should likely be an other plugin happening after the others
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
applyNodeEsmResolution,
|
|
12
|
+
lookupPackageScope,
|
|
13
|
+
readPackageJson,
|
|
14
|
+
} from "@jsenv/node-esm-resolution"
|
|
15
|
+
|
|
16
|
+
export const jsenvPluginNodeEsmResolution = ({
|
|
17
|
+
// https://nodejs.org/api/esm.html#resolver-algorithm-specification
|
|
18
|
+
packageConditions = ["browser", "import"],
|
|
19
|
+
} = {}) => {
|
|
20
|
+
const nodeEsmResolution = {
|
|
21
|
+
name: "jsenv:node_esm_resolve",
|
|
22
|
+
appliesDuring: "*",
|
|
23
|
+
resolve: {
|
|
24
|
+
js_import_export: ({ parentUrl, specifier }) => {
|
|
25
|
+
const { url } = applyNodeEsmResolution({
|
|
26
|
+
conditions: packageConditions,
|
|
27
|
+
parentUrl,
|
|
28
|
+
specifier,
|
|
29
|
+
})
|
|
30
|
+
return url
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
load: ({ url }) => {
|
|
34
|
+
if (url.startsWith("file:///@ignore/")) {
|
|
35
|
+
return {
|
|
36
|
+
content: "export default {}",
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return null
|
|
40
|
+
},
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const packageVersionInUrl = {
|
|
44
|
+
name: "jsenv:package_url_version",
|
|
45
|
+
appliesDuring: {
|
|
46
|
+
dev: true,
|
|
47
|
+
test: true,
|
|
48
|
+
},
|
|
49
|
+
transformReferencedUrl: ({ url }, { rootDirectoryUrl }) => {
|
|
50
|
+
if (!url.startsWith("file:")) {
|
|
51
|
+
return null
|
|
52
|
+
}
|
|
53
|
+
// without this check a file inside a project without package.json
|
|
54
|
+
// could be considered as a node module if there is a ancestor package.json
|
|
55
|
+
// but we want to version only node modules
|
|
56
|
+
if (!url.includes("/node_modules/")) {
|
|
57
|
+
return null
|
|
58
|
+
}
|
|
59
|
+
const urlObject = new URL(url)
|
|
60
|
+
if (urlObject.searchParams.has("v")) {
|
|
61
|
+
return null
|
|
62
|
+
}
|
|
63
|
+
const packageUrl = lookupPackageScope(url)
|
|
64
|
+
if (!packageUrl) {
|
|
65
|
+
return null
|
|
66
|
+
}
|
|
67
|
+
if (packageUrl === rootDirectoryUrl) {
|
|
68
|
+
return null
|
|
69
|
+
}
|
|
70
|
+
const packageVersion = readPackageJson(packageUrl).version
|
|
71
|
+
urlObject.searchParams.set("v", packageVersion)
|
|
72
|
+
return urlObject.href
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return [nodeEsmResolution, packageVersionInUrl]
|
|
77
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const jsenvPluginUrlResolution = () => {
|
|
2
|
+
const urlResolver = ({ parentUrl, specifier }) => {
|
|
3
|
+
return new URL(specifier, parentUrl).href
|
|
4
|
+
}
|
|
5
|
+
return {
|
|
6
|
+
name: "jsenv:url_resolution",
|
|
7
|
+
appliesDuring: "*",
|
|
8
|
+
resolve: {
|
|
9
|
+
"entry_point": urlResolver,
|
|
10
|
+
"js_import_export": urlResolver,
|
|
11
|
+
"link_href": urlResolver,
|
|
12
|
+
"script_src": urlResolver,
|
|
13
|
+
"a_href": urlResolver,
|
|
14
|
+
"iframe_src": urlResolver,
|
|
15
|
+
"img_src": urlResolver,
|
|
16
|
+
"img_srcset": urlResolver,
|
|
17
|
+
"source_src": urlResolver,
|
|
18
|
+
"source_srcset": urlResolver,
|
|
19
|
+
"image_href": urlResolver,
|
|
20
|
+
"use_href": urlResolver,
|
|
21
|
+
"css_@import": urlResolver,
|
|
22
|
+
"css_url": urlResolver,
|
|
23
|
+
"sourcemap_comment": urlResolver,
|
|
24
|
+
"js_import_meta_url_pattern": urlResolver,
|
|
25
|
+
"js_inline_content": urlResolver,
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export const jsenvPluginUrlVersion = ({
|
|
2
|
+
longTermCache = false, // will become true once things get more stable
|
|
3
|
+
} = {}) => {
|
|
4
|
+
return {
|
|
5
|
+
name: "jsenv:url_version",
|
|
6
|
+
appliesDuring: "*", // maybe only during dev?
|
|
7
|
+
normalize: ({ url }) => {
|
|
8
|
+
// "v" search param goal is to enable long-term cache
|
|
9
|
+
// for server response headers
|
|
10
|
+
// it is also used by hmr to bypass browser cache
|
|
11
|
+
// this goal is achieved when we reach this part of the code
|
|
12
|
+
// We get rid of this params so that urlGraph and other parts of the code
|
|
13
|
+
// recognize the url (it is not considered as a different url)
|
|
14
|
+
const urlObject = new URL(url)
|
|
15
|
+
urlObject.searchParams.delete("v")
|
|
16
|
+
return urlObject.href
|
|
17
|
+
},
|
|
18
|
+
transformReferencedUrl: ({ url, data }) => {
|
|
19
|
+
if (!data.version) {
|
|
20
|
+
return null
|
|
21
|
+
}
|
|
22
|
+
const urlObject = new URL(url)
|
|
23
|
+
if (urlObject.searchParams.has("v")) {
|
|
24
|
+
return null
|
|
25
|
+
}
|
|
26
|
+
urlObject.searchParams.set("v", data.version)
|
|
27
|
+
return urlObject.href
|
|
28
|
+
},
|
|
29
|
+
augmentResponse: ({ url }) => {
|
|
30
|
+
if (!longTermCache) {
|
|
31
|
+
return null
|
|
32
|
+
}
|
|
33
|
+
const urlObject = new URL(url)
|
|
34
|
+
if (!urlObject.searchParams.has("v")) {
|
|
35
|
+
return null
|
|
36
|
+
}
|
|
37
|
+
if (urlObject.searchParams.has("hmr")) {
|
|
38
|
+
return null
|
|
39
|
+
}
|
|
40
|
+
// When url is versioned put it in browser cache for 30 days
|
|
41
|
+
return {
|
|
42
|
+
headers: {
|
|
43
|
+
"cache-control": `private,max-age=${SECONDS_IN_30_DAYS},immutable`,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const SECONDS_IN_30_DAYS = 60 * 60 * 24 * 30
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsenvPluginLeadingSlash } from "./core_plugins/leading_slash/jsenv_plugin_leading_slash.js"
|
|
2
|
+
import { jsenvPluginImportmap } from "./core_plugins/importmap/jsenv_plugin_importmap.js"
|
|
3
|
+
import { jsenvPluginUrlResolution } from "./core_plugins/url_resolution/jsenv_plugin_url_resolution.js"
|
|
4
|
+
import { jsenvPluginNodeEsmResolution } from "./core_plugins/node_esm_resolution/jsenv_plugin_node_esm_resolution.js"
|
|
5
|
+
import { jsenvPluginUrlVersion } from "./core_plugins/url_version/jsenv_plugin_url_version.js"
|
|
6
|
+
import { jsenvPluginFileUrls } from "./core_plugins/file_urls/jsenv_plugin_file_urls.js"
|
|
7
|
+
import { jsenvPluginFileSystemMagic } from "./core_plugins/filesystem_magic/jsenv_plugin_filesystem_magic.js"
|
|
8
|
+
import { jsenvPluginInline } from "./core_plugins/inline/jsenv_plugin_inline.js"
|
|
9
|
+
import { jsenvPluginHtmlSupervisor } from "./core_plugins/html_supervisor/jsenv_plugin_html_supervisor.js"
|
|
10
|
+
import { jsenvPluginCommonJsGlobals } from "./core_plugins/commonjs_globals/jsenv_plugin_commonjs_globals.js"
|
|
11
|
+
import { jsenvPluginImportAssertions } from "./core_plugins/import_assertions/jsenv_plugin_import_assertions.js"
|
|
12
|
+
import { jsenvPluginImportMetaScenarios } from "./core_plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js"
|
|
13
|
+
import { jsenvPluginInjectGlobals } from "./core_plugins/inject_globals/jsenv_plugin_inject_globals.js"
|
|
14
|
+
import { jsenvPluginBabel } from "./core_plugins/babel/jsenv_plugin_babel.js"
|
|
15
|
+
|
|
16
|
+
export const getCorePlugins = ({
|
|
17
|
+
htmlSupervisor,
|
|
18
|
+
nodeEsmResolution,
|
|
19
|
+
fileSystemMagicResolution,
|
|
20
|
+
babel,
|
|
21
|
+
injectedGlobals,
|
|
22
|
+
} = {}) => {
|
|
23
|
+
const asFewAsPossible = false // useful during dev
|
|
24
|
+
return [
|
|
25
|
+
...(asFewAsPossible ? [] : [jsenvPluginImportAssertions()]),
|
|
26
|
+
...(asFewAsPossible ? [] : [jsenvPluginHtmlSupervisor(htmlSupervisor)]), // before inline as it turns inline <script> into <script src>
|
|
27
|
+
...(asFewAsPossible ? [] : [jsenvPluginInline()]), // before "file urls" to resolve and load inline urls
|
|
28
|
+
jsenvPluginImportmap(), // before node esm to handle bare specifiers before node esm
|
|
29
|
+
jsenvPluginFileUrls(),
|
|
30
|
+
jsenvPluginLeadingSlash(),
|
|
31
|
+
jsenvPluginNodeEsmResolution(nodeEsmResolution), // before url resolution to handle "js_import_export" resolution
|
|
32
|
+
jsenvPluginInjectGlobals(injectedGlobals),
|
|
33
|
+
jsenvPluginUrlResolution(),
|
|
34
|
+
...(asFewAsPossible
|
|
35
|
+
? []
|
|
36
|
+
: [jsenvPluginFileSystemMagic(fileSystemMagicResolution)]),
|
|
37
|
+
jsenvPluginUrlVersion(),
|
|
38
|
+
...(asFewAsPossible ? [] : [jsenvPluginCommonJsGlobals()]),
|
|
39
|
+
...(asFewAsPossible ? [] : [jsenvPluginImportMetaScenarios()]),
|
|
40
|
+
jsenvPluginBabel(babel),
|
|
41
|
+
]
|
|
42
|
+
}
|