@jsenv/core 26.0.1 → 27.0.0-alpha.2
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 +737 -0
- package/src/build/build_urls_generator.js +64 -0
- package/src/build/inject_version_mappings.js +62 -0
- package/src/build/plugins/bundle_js_module/jsenv_plugin_bundle_js_module.js +225 -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 +105 -0
- package/src/execute/execute.js +132 -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/babel_helper/babel_helper_directory.js +29 -0
- package/src/{internal/compile_server/js → omega/core_plugins/babel/babel_helper}/babel_plugin_babel_helpers_as_jsenv_imports.js +15 -19
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/.eslintrc.cjs +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AsyncGenerator/AsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/AwaitValue/AwaitValue.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/applyDecoratorDescriptor/applyDecoratorDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayLikeToArray/arrayLikeToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithHoles/arrayWithHoles.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/arrayWithoutHoles/arrayWithoutHoles.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/assertThisInitialized/assertThisInitialized.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncGeneratorDelegate/asyncGeneratorDelegate.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncIterator/asyncIterator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/asyncToGenerator/asyncToGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/awaitAsyncGenerator/awaitAsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorDestructureSet/classApplyDescriptorDestructureSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorGet/classApplyDescriptorGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classApplyDescriptorSet/classApplyDescriptorSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCallCheck/classCallCheck.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticAccess/classCheckPrivateStaticAccess.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classCheckPrivateStaticFieldDescriptor/classCheckPrivateStaticFieldDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classExtractFieldDescriptor/classExtractFieldDescriptor.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classNameTDZError/classNameTDZError.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldDestructureSet/classPrivateFieldDestructureSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldGet/classPrivateFieldGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseBase/classPrivateFieldLooseBase.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldLooseKey/classPrivateFieldLooseKey.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateFieldSet/classPrivateFieldSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodGet/classPrivateMethodGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classPrivateMethodSet/classPrivateMethodSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecGet/classStaticPrivateFieldSpecGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateFieldSpecSet/classStaticPrivateFieldSpecSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodGet/classStaticPrivateMethodGet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/classStaticPrivateMethodSet/classStaticPrivateMethodSet.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/construct/construct.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createClass/createClass.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelper/createForOfIteratorHelper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createForOfIteratorHelperLoose/createForOfIteratorHelperLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createRawReactElement/createRawReactElement.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/createSuper/createSuper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/decorate/decorate.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defaults/defaults.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineEnumerableProperties/defineEnumerableProperties.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/defineProperty/defineProperty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/extends/extends.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/get/get.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/getPrototypeOf/getPrototypeOf.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inherits/inherits.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/inheritsLoose/inheritsLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerDefineProperty/initializerDefineProperty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/initializerWarningHelper/initializerWarningHelper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/instanceof/instanceof.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireDefault/interopRequireDefault.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/interopRequireWildcard/interopRequireWildcard.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeFunction/isNativeFunction.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/isNativeReflectConstruct/isNativeReflectConstruct.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArray/iterableToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimit/iterableToArrayLimit.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/iterableToArrayLimitLoose/iterableToArrayLimitLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/jsx/jsx.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/maybeArrayLike/maybeArrayLike.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/newArrowCheck/newArrowCheck.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableRest/nonIterableRest.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/nonIterableSpread/nonIterableSpread.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectDestructuringEmpty/objectDestructuringEmpty.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread/objectSpread.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectSpread2/objectSpread2.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutProperties/objectWithoutProperties.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/objectWithoutPropertiesLoose/objectWithoutPropertiesLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/possibleConstructorReturn/possibleConstructorReturn.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readOnlyError/readOnlyError.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/readme.md +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/set/set.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/setPrototypeOf/setPrototypeOf.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/skipFirstGeneratorNext/skipFirstGeneratorNext.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArray/slicedToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/slicedToArrayLoose/slicedToArrayLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/superPropBase/superPropBase.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteral/taggedTemplateLiteral.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/taggedTemplateLiteralLoose/taggedTemplateLiteralLoose.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/tdz/tdz.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalRef/temporalRef.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/temporalUndefined/temporalUndefined.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toArray/toArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toConsumableArray/toConsumableArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPrimitive/toPrimitive.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/toPropertyKey/toPropertyKey.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/typeof/typeof.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/unsupportedIterableToArray/unsupportedIterableToArray.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapAsyncGenerator/wrapAsyncGenerator.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapNativeSuper/wrapNativeSuper.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/wrapRegExp/wrapRegExp.js +0 -0
- package/{helpers/babel → src/omega/core_plugins/babel/babel_helper/client}/writeOnlyError/writeOnlyError.js +0 -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/omega/core_plugins/babel/helpers/babel_plugin_structure.js +187 -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 +97 -0
- package/src/omega/core_plugins/babel/new_stylesheet/babel_plugin_new_stylesheet_as_jsenv_import.js +117 -0
- package/src/omega/core_plugins/babel/new_stylesheet/client/.eslintrc.cjs +24 -0
- 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 +80 -0
- package/src/omega/core_plugins/importmap/jsenv_plugin_importmap.js +212 -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 +210 -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 +39 -0
- package/src/omega/errors.js +168 -0
- package/src/omega/file_url_converter.js +63 -0
- package/src/omega/kitchen.js +777 -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 +91 -0
- package/src/omega/runtime_support/runtime_support.js +20 -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 +68 -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 +132 -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 +154 -211
- package/src/{execute_test_plan.js → test/execute_test_plan.js} +26 -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/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
|
@@ -1,1098 +0,0 @@
|
|
|
1
|
-
import { resolveUrl, urlToRelativeUrl } from "@jsenv/filesystem"
|
|
2
|
-
import { createLogger, loggerToLevels } from "@jsenv/logger"
|
|
3
|
-
|
|
4
|
-
import { setJavaScriptSourceMappingUrl } from "@jsenv/core/src/internal/sourcemap_utils.js"
|
|
5
|
-
import { DataUrl } from "@jsenv/core/src/internal/data_url.js"
|
|
6
|
-
|
|
7
|
-
import { racePromises } from "../promise_race.js"
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
getRessourceAsBase64Url,
|
|
11
|
-
memoize,
|
|
12
|
-
getCallerLocation,
|
|
13
|
-
formatFoundReference,
|
|
14
|
-
// formatDependenciesCollectedMessage,
|
|
15
|
-
checkContentType,
|
|
16
|
-
} from "./ressource_builder_util.js"
|
|
17
|
-
import { stringifyUrlSite } from "./url_trace.js"
|
|
18
|
-
|
|
19
|
-
export const createRessourceBuilder = (
|
|
20
|
-
{ urlFetcher, urlLoader, parseRessource },
|
|
21
|
-
{
|
|
22
|
-
logLevel,
|
|
23
|
-
format,
|
|
24
|
-
compileServerOrigin,
|
|
25
|
-
buildDirectoryUrl,
|
|
26
|
-
|
|
27
|
-
asOriginalServerUrl,
|
|
28
|
-
urlToHumanUrl,
|
|
29
|
-
|
|
30
|
-
onAsset,
|
|
31
|
-
onAssetSourceUpdated,
|
|
32
|
-
onJsModule,
|
|
33
|
-
resolveRessourceUrl,
|
|
34
|
-
buildUrlGenerator,
|
|
35
|
-
},
|
|
36
|
-
) => {
|
|
37
|
-
const logger = createLogger({ logLevel })
|
|
38
|
-
|
|
39
|
-
const createReferenceForEntryPoint = async ({
|
|
40
|
-
entryContentType,
|
|
41
|
-
entryUrl,
|
|
42
|
-
entryBuffer,
|
|
43
|
-
}) => {
|
|
44
|
-
// The entry point is conceptually referenced by code passing "entryPoints"
|
|
45
|
-
// to buildProject. So we analyse stack trace to put this function caller
|
|
46
|
-
// as the reference to this ressource file
|
|
47
|
-
// we store this info in reference.isProgrammatic
|
|
48
|
-
const callerLocation = getCallerLocation()
|
|
49
|
-
const entryReference = createReference({
|
|
50
|
-
ressourceSpecifier: entryUrl,
|
|
51
|
-
contentTypeExpected: entryContentType,
|
|
52
|
-
referenceUrl: callerLocation.url,
|
|
53
|
-
referenceLine: callerLocation.line,
|
|
54
|
-
referenceColumn: callerLocation.column,
|
|
55
|
-
|
|
56
|
-
contentType: entryContentType,
|
|
57
|
-
bufferBeforeBuild: entryBuffer,
|
|
58
|
-
isJsModule: entryContentType === "application/javascript",
|
|
59
|
-
|
|
60
|
-
isEntryPoint: true,
|
|
61
|
-
})
|
|
62
|
-
entryReference.isProgrammatic = true
|
|
63
|
-
if (entryReference.ressource.isJsModule) {
|
|
64
|
-
// no need to call getDependenciesAvailablePromise and so on
|
|
65
|
-
// rollup is handling js entries
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
await entryReference.ressource.getDependenciesAvailablePromise()
|
|
70
|
-
|
|
71
|
-
// on await que les assets, pour le js rollup s'en occupe
|
|
72
|
-
await Promise.all(
|
|
73
|
-
entryReference.ressource.dependencies.map(async (dependency) => {
|
|
74
|
-
if (dependency.contentTypeExpected === "application/importmap+json") {
|
|
75
|
-
// don't await for importmap right away, it must be handled as the very last asset
|
|
76
|
-
// to be aware of build mappings.
|
|
77
|
-
// getReadyPromise() for that importmap will be called during getAllAssetEntryEmittedPromise
|
|
78
|
-
// (a simpler approach could keep importmap untouched and override it late
|
|
79
|
-
// (but that means updating html hash and importmap hash)
|
|
80
|
-
return
|
|
81
|
-
}
|
|
82
|
-
const { ressource } = dependency
|
|
83
|
-
const readyPromise = ressource.getReadyPromise()
|
|
84
|
-
if (ressource.isJsModule) {
|
|
85
|
-
// await internally for rollup to be done with this ressource js module
|
|
86
|
-
// but don't await explicitely or rollup wait for asset builder
|
|
87
|
-
// which is waiting for rollup
|
|
88
|
-
return
|
|
89
|
-
}
|
|
90
|
-
if (!ressource.firstStrongReference) {
|
|
91
|
-
// await internally for rollup to be done to see if this ressource gets referenced
|
|
92
|
-
// but don't await explicitly or rollup would wait
|
|
93
|
-
// for asset builder which is waiting for rollup
|
|
94
|
-
return
|
|
95
|
-
}
|
|
96
|
-
if (ressource.isPlaceholder) {
|
|
97
|
-
return
|
|
98
|
-
}
|
|
99
|
-
await readyPromise
|
|
100
|
-
}),
|
|
101
|
-
)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const createReferenceFoundByRollup = (params) => {
|
|
105
|
-
return createReference({
|
|
106
|
-
fromRollup: true,
|
|
107
|
-
...params,
|
|
108
|
-
})
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const createReferenceFoundInJsModule = ({
|
|
112
|
-
referenceLabel,
|
|
113
|
-
jsUrl,
|
|
114
|
-
jsLine,
|
|
115
|
-
jsColumn,
|
|
116
|
-
isImportAssertion,
|
|
117
|
-
isJsModule,
|
|
118
|
-
|
|
119
|
-
contentTypeExpected,
|
|
120
|
-
ressourceSpecifier,
|
|
121
|
-
contentType,
|
|
122
|
-
bufferBeforeBuild,
|
|
123
|
-
}) => {
|
|
124
|
-
const reference = createReference({
|
|
125
|
-
isImportAssertion,
|
|
126
|
-
ressourceSpecifier,
|
|
127
|
-
contentTypeExpected,
|
|
128
|
-
referenceLabel,
|
|
129
|
-
referenceUrl: jsUrl,
|
|
130
|
-
referenceLine: jsLine,
|
|
131
|
-
referenceColumn: jsColumn,
|
|
132
|
-
|
|
133
|
-
contentType,
|
|
134
|
-
bufferBeforeBuild,
|
|
135
|
-
isJsModule,
|
|
136
|
-
})
|
|
137
|
-
return reference
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const getAllEntryPointsEmittedPromise = async () => {
|
|
141
|
-
const urlToWait = Object.keys(ressourceMap).filter(
|
|
142
|
-
(url) => ressourceMap[url].isEntryPoint,
|
|
143
|
-
)
|
|
144
|
-
await Promise.all(
|
|
145
|
-
urlToWait.map(async (url) => {
|
|
146
|
-
const ressource = ressourceMap[url]
|
|
147
|
-
await ressource.getReadyPromise()
|
|
148
|
-
return ressource
|
|
149
|
-
}),
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
// compute all asset fileName
|
|
153
|
-
Object.keys(ressourceMap).forEach((key) => {
|
|
154
|
-
const ressource = ressourceMap[key]
|
|
155
|
-
if (
|
|
156
|
-
ressource.isExternal ||
|
|
157
|
-
ressource.isJsModule ||
|
|
158
|
-
ressource.buildFileNameWithoutHash
|
|
159
|
-
) {
|
|
160
|
-
return
|
|
161
|
-
}
|
|
162
|
-
if (ressource.isPlaceholder && !ressource.buildRelativeUrl) {
|
|
163
|
-
return
|
|
164
|
-
}
|
|
165
|
-
if (!ressource.buildRelativeUrl) {
|
|
166
|
-
if (ressource.isPlaceholder) {
|
|
167
|
-
// placeholder not filled, that's ok
|
|
168
|
-
return
|
|
169
|
-
}
|
|
170
|
-
if (ressource.references.every((ref) => ref.isRessourceHint)) {
|
|
171
|
-
// ressource hint never used, the ressource can be ignored
|
|
172
|
-
return
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
ressource.buildFileNameWithoutHash = asFileNameWithoutHash(
|
|
176
|
-
ressource.buildRelativeUrl,
|
|
177
|
-
)
|
|
178
|
-
})
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const ressourceMap = {}
|
|
182
|
-
const ressourceRedirectionMap = {}
|
|
183
|
-
const createReference = ({
|
|
184
|
-
isRessourceHint,
|
|
185
|
-
isImportAssertion,
|
|
186
|
-
ressourceSpecifier,
|
|
187
|
-
referenceLabel,
|
|
188
|
-
referenceUrl,
|
|
189
|
-
referenceColumn,
|
|
190
|
-
referenceLine,
|
|
191
|
-
contentTypeExpected,
|
|
192
|
-
crossorigin,
|
|
193
|
-
integrity,
|
|
194
|
-
|
|
195
|
-
contentType,
|
|
196
|
-
bufferBeforeBuild,
|
|
197
|
-
isEntryPoint,
|
|
198
|
-
isJsModule,
|
|
199
|
-
isSourcemap,
|
|
200
|
-
isInline,
|
|
201
|
-
isPlaceholder,
|
|
202
|
-
|
|
203
|
-
urlVersioningDisabled,
|
|
204
|
-
|
|
205
|
-
fromRollup,
|
|
206
|
-
}) => {
|
|
207
|
-
let ressourceImporter
|
|
208
|
-
if (referenceUrl) {
|
|
209
|
-
const existingRessourceForReference = findRessourceByUrl(referenceUrl)
|
|
210
|
-
if (existingRessourceForReference) {
|
|
211
|
-
ressourceImporter = existingRessourceForReference
|
|
212
|
-
} else {
|
|
213
|
-
const referenceOriginalUrl = asOriginalServerUrl(referenceUrl)
|
|
214
|
-
if (referenceOriginalUrl) {
|
|
215
|
-
ressourceImporter = findRessourceByUrl(referenceOriginalUrl)
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
if (!ressourceImporter) {
|
|
220
|
-
// happens only for entry points?
|
|
221
|
-
// in that case the importer is theoric
|
|
222
|
-
// see "getCallerLocation()" in createReferenceForEntryPoint
|
|
223
|
-
ressourceImporter = {
|
|
224
|
-
url: referenceUrl,
|
|
225
|
-
isEntryPoint: false,
|
|
226
|
-
isJsModule: true,
|
|
227
|
-
bufferAfterBuild: "",
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
const shouldBeIgnoredWarning = referenceShouldBeIgnoredWarning({
|
|
232
|
-
isJsModule,
|
|
233
|
-
ressourceImporter,
|
|
234
|
-
ressourceSpecifier,
|
|
235
|
-
referenceUrl,
|
|
236
|
-
urlToHumanUrl,
|
|
237
|
-
})
|
|
238
|
-
if (shouldBeIgnoredWarning) {
|
|
239
|
-
logger.warn(shouldBeIgnoredWarning)
|
|
240
|
-
return null
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
const ressourceUrlResolution = resolveRessourceUrl({
|
|
244
|
-
ressourceSpecifier,
|
|
245
|
-
isJsModule,
|
|
246
|
-
isInline,
|
|
247
|
-
isRessourceHint,
|
|
248
|
-
ressourceImporter,
|
|
249
|
-
})
|
|
250
|
-
|
|
251
|
-
let ressourceUrl
|
|
252
|
-
let isExternal = false
|
|
253
|
-
let isWorker = false
|
|
254
|
-
let isServiceWorker = false
|
|
255
|
-
let isCrossOrigin = false
|
|
256
|
-
if (typeof ressourceUrlResolution === "object") {
|
|
257
|
-
ressourceUrl = ressourceUrlResolution.url
|
|
258
|
-
if (ressourceUrlResolution.isCrossOrigin) {
|
|
259
|
-
isCrossOrigin = true
|
|
260
|
-
}
|
|
261
|
-
if (ressourceUrlResolution.isExternal) {
|
|
262
|
-
isExternal = true
|
|
263
|
-
}
|
|
264
|
-
if (ressourceUrlResolution.isWorker) {
|
|
265
|
-
isWorker = true
|
|
266
|
-
}
|
|
267
|
-
if (ressourceUrlResolution.isServiceWorker) {
|
|
268
|
-
isServiceWorker = true
|
|
269
|
-
}
|
|
270
|
-
if (ressourceUrlResolution.isJsModule) {
|
|
271
|
-
isJsModule = true
|
|
272
|
-
}
|
|
273
|
-
} else {
|
|
274
|
-
ressourceUrl = ressourceUrlResolution
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
if (ressourceUrl.startsWith("data:")) {
|
|
278
|
-
isExternal = false
|
|
279
|
-
isInline = true
|
|
280
|
-
const { mediaType, base64Flag, data } = DataUrl.parse(ressourceUrl)
|
|
281
|
-
contentTypeExpected = mediaType
|
|
282
|
-
contentType = mediaType
|
|
283
|
-
bufferBeforeBuild = base64Flag
|
|
284
|
-
? Buffer.from(data, "base64")
|
|
285
|
-
: decodeURI(data)
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
// any hash in the url would mess up with filenames
|
|
289
|
-
ressourceUrl = removePotentialUrlHash(ressourceUrl)
|
|
290
|
-
|
|
291
|
-
const existingRessource = findRessourceByUrl(ressourceUrl)
|
|
292
|
-
let ressource
|
|
293
|
-
if (existingRessource) {
|
|
294
|
-
ressource = existingRessource
|
|
295
|
-
// allow to update the bufferBeforeBuild on existingRessource
|
|
296
|
-
// this happens when rollup loads a js file and communicates to this code
|
|
297
|
-
// what was loaded
|
|
298
|
-
if (fromRollup) {
|
|
299
|
-
ressource.bufferBeforeBuild = bufferBeforeBuild
|
|
300
|
-
ressource.contentType = contentType
|
|
301
|
-
}
|
|
302
|
-
} else {
|
|
303
|
-
ressource = createRessource({
|
|
304
|
-
contentType,
|
|
305
|
-
ressourceUrl,
|
|
306
|
-
ressourceImporter,
|
|
307
|
-
bufferBeforeBuild,
|
|
308
|
-
|
|
309
|
-
isEntryPoint,
|
|
310
|
-
isJsModule,
|
|
311
|
-
isSourcemap,
|
|
312
|
-
isCrossOrigin,
|
|
313
|
-
isExternal,
|
|
314
|
-
isInline,
|
|
315
|
-
isPlaceholder,
|
|
316
|
-
isWorker,
|
|
317
|
-
isServiceWorker,
|
|
318
|
-
|
|
319
|
-
urlVersioningDisabled,
|
|
320
|
-
})
|
|
321
|
-
ressourceMap[ressourceUrl] = ressource
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
const reference = {
|
|
325
|
-
fromRollup,
|
|
326
|
-
isRessourceHint,
|
|
327
|
-
isImportAssertion,
|
|
328
|
-
referenceLabel,
|
|
329
|
-
referenceUrl,
|
|
330
|
-
referenceColumn,
|
|
331
|
-
referenceLine,
|
|
332
|
-
contentTypeExpected,
|
|
333
|
-
crossorigin,
|
|
334
|
-
integrity,
|
|
335
|
-
|
|
336
|
-
isInline,
|
|
337
|
-
inlinedCallback: () => {
|
|
338
|
-
reference.isInline = true
|
|
339
|
-
const allStrongReferenceAreInline = ressource.references.every(
|
|
340
|
-
(reference) => reference.isRessourceHint || reference.isInline,
|
|
341
|
-
)
|
|
342
|
-
if (allStrongReferenceAreInline) {
|
|
343
|
-
ressource.isInline = true
|
|
344
|
-
ressource.inlinedCallbacks.forEach((callback) => callback())
|
|
345
|
-
}
|
|
346
|
-
},
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
reference.ressource = ressource
|
|
350
|
-
if (fromRollup) {
|
|
351
|
-
if (ressourceImporter.isEntryPoint) {
|
|
352
|
-
// When HTML references JS, ressource builder has emitted the js chunk.
|
|
353
|
-
// so it already knows it exists and is part of references
|
|
354
|
-
// -> no need to push into reference (would incorrectly consider html references js twice)
|
|
355
|
-
// -> no need to log the js ressource (already logged during the HTML parsing)
|
|
356
|
-
return reference
|
|
357
|
-
}
|
|
358
|
-
if (ressource.isEntryPoint) {
|
|
359
|
-
// When rollup "loads" a js entry point, ressource builder is already aware of it
|
|
360
|
-
// because of "createReferenceForEntryPoint"
|
|
361
|
-
return reference
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
ressource.references.push(reference)
|
|
366
|
-
const effects = ressource.applyReferenceEffects(reference, { isJsModule })
|
|
367
|
-
if (loggerToLevels(logger).debug) {
|
|
368
|
-
logger.debug(
|
|
369
|
-
formatFoundReference({
|
|
370
|
-
reference,
|
|
371
|
-
referenceEffects: effects,
|
|
372
|
-
showReferenceSourceLocation,
|
|
373
|
-
urlToHumanUrl,
|
|
374
|
-
}),
|
|
375
|
-
)
|
|
376
|
-
}
|
|
377
|
-
return reference
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
const ressourceTransformMap = {}
|
|
381
|
-
|
|
382
|
-
const createRessource = ({
|
|
383
|
-
contentType,
|
|
384
|
-
ressourceUrl,
|
|
385
|
-
ressourceImporter,
|
|
386
|
-
bufferBeforeBuild,
|
|
387
|
-
|
|
388
|
-
isEntryPoint = false,
|
|
389
|
-
isJsModule = false,
|
|
390
|
-
isSourcemap = false,
|
|
391
|
-
isCrossOrigin = false,
|
|
392
|
-
isExternal = false,
|
|
393
|
-
isInline = false,
|
|
394
|
-
isPlaceholder = false,
|
|
395
|
-
isWorker = false,
|
|
396
|
-
isServiceWorker = false,
|
|
397
|
-
|
|
398
|
-
urlVersioningDisabled,
|
|
399
|
-
}) => {
|
|
400
|
-
const ressource = {
|
|
401
|
-
contentType,
|
|
402
|
-
url: ressourceUrl,
|
|
403
|
-
importer: ressourceImporter,
|
|
404
|
-
bufferBeforeBuild,
|
|
405
|
-
bufferAfterBuild: undefined,
|
|
406
|
-
firstStrongReference: null,
|
|
407
|
-
references: [],
|
|
408
|
-
|
|
409
|
-
isEntryPoint,
|
|
410
|
-
isJsModule,
|
|
411
|
-
isSourcemap,
|
|
412
|
-
isInline,
|
|
413
|
-
isCrossOrigin,
|
|
414
|
-
isExternal,
|
|
415
|
-
isPlaceholder,
|
|
416
|
-
isWorker,
|
|
417
|
-
isServiceWorker,
|
|
418
|
-
|
|
419
|
-
urlVersioningDisabled,
|
|
420
|
-
|
|
421
|
-
relativeUrl: ressourceUrl.startsWith(compileServerOrigin)
|
|
422
|
-
? urlToRelativeUrl(ressourceUrl, compileServerOrigin)
|
|
423
|
-
: urlToRelativeUrl(ressourceUrl, buildDirectoryUrl),
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
const { buildRelativeUrlPattern, buildRelativeUrlWithoutHash } =
|
|
427
|
-
buildUrlGenerator.prepareBuildUrlForRessource(ressource)
|
|
428
|
-
ressource.buildRelativeUrlWithoutHash = buildRelativeUrlWithoutHash
|
|
429
|
-
ressource.buildRelativeUrlPattern = buildRelativeUrlPattern
|
|
430
|
-
|
|
431
|
-
ressource.usedPromise = new Promise((resolve) => {
|
|
432
|
-
ressource.usedCallback = resolve
|
|
433
|
-
})
|
|
434
|
-
ressource.inlinedCallbacks = []
|
|
435
|
-
ressource.buildEndCalledCallbacks = []
|
|
436
|
-
ressource.buildEndCalledPromise = new Promise((resolve) => {
|
|
437
|
-
ressource.buildEndCalledCallbacks.push(resolve)
|
|
438
|
-
})
|
|
439
|
-
ressource.rollupBuildDoneCallbacks = []
|
|
440
|
-
ressource.rollupBuildDonePromise = new Promise((resolve) => {
|
|
441
|
-
ressource.rollupBuildDoneCallbacks.push(resolve)
|
|
442
|
-
})
|
|
443
|
-
|
|
444
|
-
const getBufferAvailablePromise = memoize(async () => {
|
|
445
|
-
if (ressource.isJsModule) {
|
|
446
|
-
await ressource.rollupBuildDonePromise
|
|
447
|
-
return
|
|
448
|
-
}
|
|
449
|
-
// sourcemap placeholder buffer is ready once buildEnd is called on it
|
|
450
|
-
if (ressource.isPlaceholder) {
|
|
451
|
-
await ressource.buildEndCalledPromise
|
|
452
|
-
return
|
|
453
|
-
}
|
|
454
|
-
if (!ressource.firstStrongReference) {
|
|
455
|
-
// for preload/prefetch links, we don't want to start the prefetching right away.
|
|
456
|
-
// Instead we wait for something else to reference the same ressource
|
|
457
|
-
// This is by choice so that:
|
|
458
|
-
// 1. The warning about "preload but never used" is prio fetch errors like "preload not found"
|
|
459
|
-
// 2. We don't start fetching a ressource found in HTML while rollup
|
|
460
|
-
// could do the same later. It means we should synchronize rollup
|
|
461
|
-
// and this asset builder fetching to avoid fetching twice.
|
|
462
|
-
// This scenario would be reproduced for every js module preloaded
|
|
463
|
-
const { usedPromise, rollupBuildDonePromise } = ressource
|
|
464
|
-
const winner = await racePromises([usedPromise, rollupBuildDonePromise])
|
|
465
|
-
if (winner.promise === rollupBuildDonePromise) {
|
|
466
|
-
return
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
const ressourceUrl = ressource.url
|
|
470
|
-
const response = await urlFetcher.fetchUrl(ressourceUrl, {
|
|
471
|
-
contentTypeExpected: ressource.firstStrongReference.contentTypeExpected,
|
|
472
|
-
crossorigin: ressource.firstStrongReference.crossorigin,
|
|
473
|
-
integrity: ressource.firstStrongReference.integrity,
|
|
474
|
-
urlTrace: () => {
|
|
475
|
-
return createRessourceTrace({
|
|
476
|
-
ressource,
|
|
477
|
-
createUrlSiteFromReference,
|
|
478
|
-
findRessourceByUrl,
|
|
479
|
-
})
|
|
480
|
-
},
|
|
481
|
-
})
|
|
482
|
-
if (response.url !== ressourceUrl) {
|
|
483
|
-
const urlBeforeRedirection = ressourceUrl
|
|
484
|
-
const urlAfterRedirection = response.url
|
|
485
|
-
ressourceRedirectionMap[urlBeforeRedirection] = urlAfterRedirection
|
|
486
|
-
ressource.url = urlAfterRedirection
|
|
487
|
-
}
|
|
488
|
-
const responseContentTypeHeader = response.headers["content-type"]
|
|
489
|
-
ressource.contentType = responseContentTypeHeader
|
|
490
|
-
const responseBodyAsArrayBuffer = await response.arrayBuffer()
|
|
491
|
-
ressource.bufferBeforeBuild = Buffer.from(responseBodyAsArrayBuffer)
|
|
492
|
-
// TODO here: integrity check
|
|
493
|
-
})
|
|
494
|
-
|
|
495
|
-
const setBufferBeforeBuild = (bufferBeforeBuild) => {
|
|
496
|
-
ressource.bufferBeforeBuild = bufferBeforeBuild
|
|
497
|
-
getBufferAvailablePromise.forceMemoization(Promise.resolve())
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
const getDependenciesAvailablePromise = memoize(async () => {
|
|
501
|
-
await getBufferAvailablePromise()
|
|
502
|
-
|
|
503
|
-
if (ressource.isJsModule) {
|
|
504
|
-
ressource.dependencies = []
|
|
505
|
-
return
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
const dependencies = []
|
|
509
|
-
|
|
510
|
-
let parsingDone = false
|
|
511
|
-
const notifyReferenceFound = ({
|
|
512
|
-
isRessourceHint,
|
|
513
|
-
contentTypeExpected,
|
|
514
|
-
crossorigin,
|
|
515
|
-
integrity,
|
|
516
|
-
ressourceSpecifier,
|
|
517
|
-
referenceLabel,
|
|
518
|
-
referenceLine,
|
|
519
|
-
referenceColumn,
|
|
520
|
-
|
|
521
|
-
contentType,
|
|
522
|
-
bufferBeforeBuild,
|
|
523
|
-
isJsModule = false,
|
|
524
|
-
isInline = false,
|
|
525
|
-
isSourcemap = false,
|
|
526
|
-
isPlaceholder = false,
|
|
527
|
-
urlVersioningDisabled,
|
|
528
|
-
}) => {
|
|
529
|
-
if (parsingDone) {
|
|
530
|
-
throw new Error(
|
|
531
|
-
`notifyReferenceFound cannot be called once ${ressource.url} parsing is done.`,
|
|
532
|
-
)
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
const dependencyReference = createReference({
|
|
536
|
-
ressourceSpecifier,
|
|
537
|
-
referenceLabel,
|
|
538
|
-
referenceUrl: ressource.url,
|
|
539
|
-
referenceLine,
|
|
540
|
-
referenceColumn,
|
|
541
|
-
isRessourceHint,
|
|
542
|
-
contentTypeExpected,
|
|
543
|
-
crossorigin,
|
|
544
|
-
integrity,
|
|
545
|
-
|
|
546
|
-
contentType,
|
|
547
|
-
bufferBeforeBuild,
|
|
548
|
-
isJsModule,
|
|
549
|
-
isInline,
|
|
550
|
-
isSourcemap,
|
|
551
|
-
isPlaceholder,
|
|
552
|
-
|
|
553
|
-
urlVersioningDisabled,
|
|
554
|
-
})
|
|
555
|
-
|
|
556
|
-
if (dependencyReference) {
|
|
557
|
-
dependencies.push(dependencyReference)
|
|
558
|
-
}
|
|
559
|
-
return dependencyReference
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
if (!ressource.isEntryPoint) {
|
|
563
|
-
logger.debug(`parse ${urlToHumanUrl(ressource.url)}`)
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
const parseReturnValue = await parseRessource(ressource, {
|
|
567
|
-
format,
|
|
568
|
-
notifyReferenceFound,
|
|
569
|
-
})
|
|
570
|
-
parsingDone = true
|
|
571
|
-
|
|
572
|
-
if (dependencies.length > 0 && typeof parseReturnValue !== "function") {
|
|
573
|
-
throw new Error(
|
|
574
|
-
`parse notified some dependencies, it must return a function but received ${parseReturnValue}`,
|
|
575
|
-
)
|
|
576
|
-
}
|
|
577
|
-
if (typeof parseReturnValue === "function") {
|
|
578
|
-
ressourceTransformMap[ressource.url] = parseReturnValue
|
|
579
|
-
}
|
|
580
|
-
ressource.dependencies = dependencies
|
|
581
|
-
// if (dependencies.length > 0) {
|
|
582
|
-
// logger.debug(formatDependenciesCollectedMessage({ ressource, shortenUrl }))
|
|
583
|
-
// }
|
|
584
|
-
})
|
|
585
|
-
|
|
586
|
-
const getReadyPromise = memoize(async () => {
|
|
587
|
-
if (ressource.isExternal) {
|
|
588
|
-
// external urls are immediatly available and not modified
|
|
589
|
-
return
|
|
590
|
-
}
|
|
591
|
-
|
|
592
|
-
// la transformation d'un asset c'est avant tout la transformation de ses dépendances
|
|
593
|
-
await getDependenciesAvailablePromise()
|
|
594
|
-
const dependencies = ressource.dependencies
|
|
595
|
-
await Promise.all(
|
|
596
|
-
dependencies.map(async (dependencyReference) => {
|
|
597
|
-
const dependencyRessource = dependencyReference.ressource
|
|
598
|
-
if (dependencyRessource.isPlaceholder) {
|
|
599
|
-
return
|
|
600
|
-
}
|
|
601
|
-
// don't keep waiting for ever in case ressource hint is never used
|
|
602
|
-
if (dependencyReference.isRessourceHint) {
|
|
603
|
-
return
|
|
604
|
-
}
|
|
605
|
-
await dependencyRessource.getReadyPromise()
|
|
606
|
-
}),
|
|
607
|
-
)
|
|
608
|
-
|
|
609
|
-
const transform = ressourceTransformMap[ressource.url]
|
|
610
|
-
if (typeof transform !== "function") {
|
|
611
|
-
if (ressource.isPlaceholder) {
|
|
612
|
-
return
|
|
613
|
-
}
|
|
614
|
-
// sourcemap content depends on their source file
|
|
615
|
-
// sourcemap.buildEnd() will be called by the source file
|
|
616
|
-
if (ressource.isSourcemap) {
|
|
617
|
-
return
|
|
618
|
-
}
|
|
619
|
-
ressource.buildEnd(
|
|
620
|
-
ressource.bufferAfterBuild || ressource.bufferBeforeBuild,
|
|
621
|
-
ressource.buildRelativeUrl,
|
|
622
|
-
)
|
|
623
|
-
return
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
// assetDependenciesMapping contains all dependencies for an asset
|
|
627
|
-
// each key is the absolute url to the dependency file
|
|
628
|
-
// each value is an url relative to the asset importing this dependency
|
|
629
|
-
// it looks like this:
|
|
630
|
-
// {
|
|
631
|
-
// "file:///project/coin.png": "./coin-45eiopri.png"
|
|
632
|
-
// }
|
|
633
|
-
// we don't yet know the exact importerBuildRelativeUrl but we can generate a fake one
|
|
634
|
-
// to ensure we resolve dependency against where the importer file will be
|
|
635
|
-
const importer = ressource
|
|
636
|
-
await transform({
|
|
637
|
-
buildDirectoryUrl,
|
|
638
|
-
getUrlRelativeToImporter: (referencedRessource) => {
|
|
639
|
-
const referenceBuildRelativeUrl = importer.isJsModule
|
|
640
|
-
? // js can reference an url without versionning
|
|
641
|
-
// and actually fetch the versioned url thanks to importmap
|
|
642
|
-
referencedRessource.buildRelativeUrlWithoutHash
|
|
643
|
-
: // other ressource must use the exact url
|
|
644
|
-
referencedRessource.buildRelativeUrl
|
|
645
|
-
const referenceBuildUrl = resolveUrl(
|
|
646
|
-
referenceBuildRelativeUrl,
|
|
647
|
-
"file:///",
|
|
648
|
-
)
|
|
649
|
-
const importerBuildUrl = resolveUrl(
|
|
650
|
-
importer.buildRelativeUrlWithoutHash,
|
|
651
|
-
"file:///",
|
|
652
|
-
)
|
|
653
|
-
return urlToRelativeUrl(referenceBuildUrl, importerBuildUrl)
|
|
654
|
-
},
|
|
655
|
-
getOriginalRessource: (ressource) => {
|
|
656
|
-
const originalServerUrl = asOriginalServerUrl(ressource.url)
|
|
657
|
-
return ressourceMap[originalServerUrl]
|
|
658
|
-
},
|
|
659
|
-
})
|
|
660
|
-
if (typeof ressource.bufferAfterBuild === "undefined") {
|
|
661
|
-
throw new Error(
|
|
662
|
-
`transform must call ressource.buildEnd() for ${ressource.url}`,
|
|
663
|
-
)
|
|
664
|
-
}
|
|
665
|
-
})
|
|
666
|
-
|
|
667
|
-
// was used to remove sourcemap files that are renamed after they are emitted
|
|
668
|
-
// could be useful one day in case an asset is finally discarded
|
|
669
|
-
const remove = () => {
|
|
670
|
-
ressource.shouldBeIgnored = true
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
const buildEnd = (bufferAfterBuild, buildRelativeUrl) => {
|
|
674
|
-
if (bufferAfterBuild !== undefined) {
|
|
675
|
-
ressource.bufferAfterBuild = bufferAfterBuild
|
|
676
|
-
if (buildRelativeUrl === undefined) {
|
|
677
|
-
ressource.buildRelativeUrl =
|
|
678
|
-
buildUrlGenerator.computeBuildRelativeUrl(ressource)
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
|
|
682
|
-
if (buildRelativeUrl !== undefined) {
|
|
683
|
-
ressource.buildRelativeUrl = buildRelativeUrl
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
if (
|
|
687
|
-
// ressource.bufferAfterBuild can be undefined when ressource is only preloaded
|
|
688
|
-
// and never used
|
|
689
|
-
ressource.bufferAfterBuild &&
|
|
690
|
-
!ressource.isInline &&
|
|
691
|
-
!ressource.isJsModule
|
|
692
|
-
) {
|
|
693
|
-
onAssetSourceUpdated({ ressource })
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
const applyReferenceEffects = (reference, infoFromReference) => {
|
|
698
|
-
const effects = []
|
|
699
|
-
if (reference.fromRollup && ressource.isJsModule && ressource.isInline) {
|
|
700
|
-
return effects
|
|
701
|
-
}
|
|
702
|
-
if (ressource.isEntryPoint) {
|
|
703
|
-
if (ressource.contentType === "text/html") {
|
|
704
|
-
effects.push(`parse html to find references`)
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
if (reference.isRessourceHint) {
|
|
708
|
-
// do not try to load or fetch this file
|
|
709
|
-
// we'll wait for something to reference it
|
|
710
|
-
// if nothing references it a warning will be logged
|
|
711
|
-
return effects
|
|
712
|
-
}
|
|
713
|
-
ressource.getBufferAvailablePromise().then(
|
|
714
|
-
() => {
|
|
715
|
-
if (ressource.firstStrongReference) {
|
|
716
|
-
checkContentType(reference, { logger, showReferenceSourceLocation })
|
|
717
|
-
}
|
|
718
|
-
},
|
|
719
|
-
() => {},
|
|
720
|
-
)
|
|
721
|
-
if (ressource.firstStrongReference) {
|
|
722
|
-
// this ressource was already strongly referenced by something
|
|
723
|
-
// don't try to load it twice
|
|
724
|
-
return effects
|
|
725
|
-
}
|
|
726
|
-
ressource.firstStrongReference = reference
|
|
727
|
-
// the first strong reference is allowed to transform a reference where we did not know if it was
|
|
728
|
-
// a js module to a js module
|
|
729
|
-
// This happen for preload link following by a script type module
|
|
730
|
-
// <link rel="preload" href="file.js" />
|
|
731
|
-
// <script type="module" src="file.js"></script>
|
|
732
|
-
if (!ressource.isJsModule && infoFromReference.isJsModule) {
|
|
733
|
-
effects.push(`mark ${urlToHumanUrl(ressource.url)} as js module`)
|
|
734
|
-
ressource.isJsModule = infoFromReference.isJsModule
|
|
735
|
-
}
|
|
736
|
-
ressource.usedCallback()
|
|
737
|
-
if (ressource.isExternal) {
|
|
738
|
-
// nothing to do
|
|
739
|
-
return effects
|
|
740
|
-
}
|
|
741
|
-
if (ressource.isJsModule) {
|
|
742
|
-
const jsModuleUrl = ressource.url
|
|
743
|
-
const rollupChunk = onJsModule({
|
|
744
|
-
ressource,
|
|
745
|
-
jsModuleUrl,
|
|
746
|
-
jsModuleIsInline: ressource.isInline,
|
|
747
|
-
jsModuleSource: String(bufferBeforeBuild),
|
|
748
|
-
line: reference.referenceLine,
|
|
749
|
-
column: reference.referenceColumn,
|
|
750
|
-
})
|
|
751
|
-
if (rollupChunk) {
|
|
752
|
-
ressource.rollupReferenceId = rollupChunk.rollupReferenceId
|
|
753
|
-
effects.push(
|
|
754
|
-
`emit rollup chunk "${rollupChunk.fileName}" (${rollupChunk.rollupReferenceId})`,
|
|
755
|
-
)
|
|
756
|
-
}
|
|
757
|
-
return effects
|
|
758
|
-
}
|
|
759
|
-
if (ressource.isInline) {
|
|
760
|
-
// nothing to do
|
|
761
|
-
return effects
|
|
762
|
-
}
|
|
763
|
-
const rollupAsset = onAsset({
|
|
764
|
-
ressource,
|
|
765
|
-
})
|
|
766
|
-
ressource.rollupReferenceId = rollupAsset.rollupReferenceId
|
|
767
|
-
effects.push(
|
|
768
|
-
`emit rollup asset "${rollupAsset.fileName}" (${rollupAsset.rollupReferenceId})`,
|
|
769
|
-
)
|
|
770
|
-
return effects
|
|
771
|
-
}
|
|
772
|
-
|
|
773
|
-
if (bufferBeforeBuild !== undefined) {
|
|
774
|
-
setBufferBeforeBuild(bufferBeforeBuild)
|
|
775
|
-
}
|
|
776
|
-
Object.assign(ressource, {
|
|
777
|
-
applyReferenceEffects,
|
|
778
|
-
getBufferAvailablePromise,
|
|
779
|
-
getDependenciesAvailablePromise,
|
|
780
|
-
getReadyPromise,
|
|
781
|
-
remove,
|
|
782
|
-
setBufferBeforeBuild,
|
|
783
|
-
buildEnd,
|
|
784
|
-
})
|
|
785
|
-
return ressource
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
const rollupBuildEnd = ({
|
|
789
|
-
rollupResult,
|
|
790
|
-
useImportMapToMaximizeCacheReuse,
|
|
791
|
-
}) => {
|
|
792
|
-
const jsRessources = {}
|
|
793
|
-
Object.keys(ressourceMap).forEach((ressourceUrl) => {
|
|
794
|
-
const ressource = ressourceMap[ressourceUrl]
|
|
795
|
-
const rollupFileName = Object.keys(rollupResult).find((key) => {
|
|
796
|
-
const rollupFileInfo = rollupResult[key]
|
|
797
|
-
return (
|
|
798
|
-
rollupFileInfo.url === ressourceUrl ||
|
|
799
|
-
// asset
|
|
800
|
-
ressource.buildFileNameWithoutHash === key ||
|
|
801
|
-
ressource.relativeUrl === key
|
|
802
|
-
)
|
|
803
|
-
})
|
|
804
|
-
if (rollupFileName) {
|
|
805
|
-
const rollupFileInfo = rollupResult[rollupFileName]
|
|
806
|
-
if (rollupFileInfo.type === "asset") {
|
|
807
|
-
ressource.buildFileNameWithoutHash = rollupFileName
|
|
808
|
-
return
|
|
809
|
-
}
|
|
810
|
-
if (rollupFileInfo.type === "chunk") {
|
|
811
|
-
applyBuildEndEffects(ressource, {
|
|
812
|
-
rollupFileInfo,
|
|
813
|
-
rollupResult,
|
|
814
|
-
useImportMapToMaximizeCacheReuse,
|
|
815
|
-
})
|
|
816
|
-
const { rollupBuildDoneCallbacks } = ressource
|
|
817
|
-
rollupBuildDoneCallbacks.forEach((rollupBuildDoneCallback) => {
|
|
818
|
-
rollupBuildDoneCallback()
|
|
819
|
-
})
|
|
820
|
-
if (rollupFileInfo.type === "chunk") {
|
|
821
|
-
jsRessources[ressourceUrl] = ressource
|
|
822
|
-
}
|
|
823
|
-
return
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
})
|
|
827
|
-
return { jsRessources }
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
const applyBuildEndEffects = (
|
|
831
|
-
ressource,
|
|
832
|
-
{ rollupFileInfo, rollupResult, useImportMapToMaximizeCacheReuse },
|
|
833
|
-
) => {
|
|
834
|
-
const fileName = rollupFileInfo.fileName
|
|
835
|
-
let code = rollupFileInfo.code
|
|
836
|
-
ressource.contentType = "application/javascript"
|
|
837
|
-
if (useImportMapToMaximizeCacheReuse) {
|
|
838
|
-
ressource.buildFileNameWithoutHash = fileName
|
|
839
|
-
ressource.buildEnd(code)
|
|
840
|
-
} else {
|
|
841
|
-
ressource.buildFileNameWithoutHash = asFileNameWithoutHash(fileName)
|
|
842
|
-
ressource.buildEnd(code, fileName)
|
|
843
|
-
}
|
|
844
|
-
const map = rollupFileInfo.map
|
|
845
|
-
if (map) {
|
|
846
|
-
const sourcemapBuildRelativeUrl = `${ressource.buildRelativeUrl}.map`
|
|
847
|
-
const sourcemapRollupFileInfo = rollupResult[sourcemapBuildRelativeUrl]
|
|
848
|
-
if (!sourcemapRollupFileInfo) {
|
|
849
|
-
const ressourceBuildUrl = resolveUrl(
|
|
850
|
-
ressource.buildRelativeUrl,
|
|
851
|
-
buildDirectoryUrl,
|
|
852
|
-
)
|
|
853
|
-
const sourcemapBuildUrl = resolveUrl(
|
|
854
|
-
sourcemapBuildRelativeUrl,
|
|
855
|
-
buildDirectoryUrl,
|
|
856
|
-
)
|
|
857
|
-
const sourcemapAsString = JSON.stringify(rollupFileInfo.map, null, " ")
|
|
858
|
-
const sourcemapBuildUrlRelativeToFileBuildUrl = urlToRelativeUrl(
|
|
859
|
-
sourcemapBuildUrl,
|
|
860
|
-
ressourceBuildUrl,
|
|
861
|
-
)
|
|
862
|
-
const codeWithSourcemapComment = setJavaScriptSourceMappingUrl(
|
|
863
|
-
rollupFileInfo.code,
|
|
864
|
-
sourcemapBuildUrlRelativeToFileBuildUrl,
|
|
865
|
-
)
|
|
866
|
-
ressource.bufferAfterBuild = codeWithSourcemapComment
|
|
867
|
-
rollupFileInfo.code = codeWithSourcemapComment
|
|
868
|
-
const sourcemapReference = createReference({
|
|
869
|
-
referenceLabel: "js sourcemapping comment",
|
|
870
|
-
contentType: "application/octet-stream",
|
|
871
|
-
ressourceSpecifier: sourcemapBuildUrlRelativeToFileBuildUrl,
|
|
872
|
-
referenceUrl: ressourceBuildUrl,
|
|
873
|
-
referenceLine: codeWithSourcemapComment.split(/\r?\n/).length,
|
|
874
|
-
// ${"//#"} is to avoid a parser thinking there is a sourceMappingUrl for this file
|
|
875
|
-
referenceColumn: `${"//#"} sourceMappingURL=`.length + 1,
|
|
876
|
-
isSourcemap: true,
|
|
877
|
-
isPlaceholder: true,
|
|
878
|
-
})
|
|
879
|
-
sourcemapReference.ressource.buildEnd(
|
|
880
|
-
sourcemapAsString,
|
|
881
|
-
sourcemapBuildUrlRelativeToFileBuildUrl,
|
|
882
|
-
)
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
const findRessourceByUrl = (url) => {
|
|
888
|
-
if (url in ressourceMap) {
|
|
889
|
-
return ressourceMap[url]
|
|
890
|
-
}
|
|
891
|
-
if (url in ressourceRedirectionMap) {
|
|
892
|
-
return findRessourceByUrl(ressourceRedirectionMap[url])
|
|
893
|
-
}
|
|
894
|
-
return null
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
const findRessource = (predicate) => {
|
|
898
|
-
let ressourceFound = null
|
|
899
|
-
Object.keys(ressourceMap).find((url) => {
|
|
900
|
-
const ressourceCandidate = ressourceMap[url]
|
|
901
|
-
if (predicate(ressourceCandidate)) {
|
|
902
|
-
ressourceFound = ressourceCandidate
|
|
903
|
-
return true
|
|
904
|
-
}
|
|
905
|
-
return false
|
|
906
|
-
})
|
|
907
|
-
return ressourceFound
|
|
908
|
-
}
|
|
909
|
-
|
|
910
|
-
const createUrlSiteFromReference = (reference) => {
|
|
911
|
-
const { referenceUrl, referenceLine, referenceColumn } = reference
|
|
912
|
-
const referenceRessource = findRessourceByUrl(referenceUrl)
|
|
913
|
-
const referenceSource = referenceRessource
|
|
914
|
-
? referenceRessource.bufferBeforeBuild
|
|
915
|
-
: urlLoader.getUrlResponseTextFromMemory(referenceUrl)
|
|
916
|
-
const referenceSourceAsString = referenceSource
|
|
917
|
-
? String(referenceSource)
|
|
918
|
-
: ""
|
|
919
|
-
|
|
920
|
-
const urlSite = {
|
|
921
|
-
type:
|
|
922
|
-
referenceRessource && referenceRessource.isJsModule
|
|
923
|
-
? "import"
|
|
924
|
-
: "reference",
|
|
925
|
-
url: urlToHumanUrl(referenceUrl),
|
|
926
|
-
line: referenceLine,
|
|
927
|
-
column: referenceColumn,
|
|
928
|
-
source: referenceSourceAsString,
|
|
929
|
-
}
|
|
930
|
-
|
|
931
|
-
if (!referenceRessource) {
|
|
932
|
-
return urlSite
|
|
933
|
-
}
|
|
934
|
-
if (!referenceRessource.isInline) {
|
|
935
|
-
return urlSite
|
|
936
|
-
}
|
|
937
|
-
const { firstStrongReference } = referenceRessource
|
|
938
|
-
if (!firstStrongReference) {
|
|
939
|
-
return urlSite
|
|
940
|
-
}
|
|
941
|
-
const htmlUrlSite = createUrlSiteFromReference(firstStrongReference)
|
|
942
|
-
// when the html node is injected there is no line in the source file to target
|
|
943
|
-
if (htmlUrlSite.line === undefined) {
|
|
944
|
-
return urlSite
|
|
945
|
-
}
|
|
946
|
-
const importerRessource = findRessourceByUrl(
|
|
947
|
-
firstStrongReference.referenceUrl,
|
|
948
|
-
)
|
|
949
|
-
if (!importerRessource || importerRessource.contentType !== "text/html") {
|
|
950
|
-
return urlSite
|
|
951
|
-
}
|
|
952
|
-
return {
|
|
953
|
-
...htmlUrlSite,
|
|
954
|
-
line:
|
|
955
|
-
typeof urlSite.line === "number"
|
|
956
|
-
? htmlUrlSite.line + urlSite.line
|
|
957
|
-
: htmlUrlSite.line,
|
|
958
|
-
column:
|
|
959
|
-
typeof urlSite.column === "number"
|
|
960
|
-
? htmlUrlSite.column + urlSite.column
|
|
961
|
-
: htmlUrlSite.column,
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
const showReferenceSourceLocation = (reference) => {
|
|
966
|
-
return stringifyUrlSite(createUrlSiteFromReference(reference))
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
return {
|
|
970
|
-
createReferenceForEntryPoint,
|
|
971
|
-
createReferenceFoundByRollup,
|
|
972
|
-
createReferenceFoundInJsModule,
|
|
973
|
-
|
|
974
|
-
rollupBuildEnd,
|
|
975
|
-
getAllEntryPointsEmittedPromise,
|
|
976
|
-
findRessource,
|
|
977
|
-
|
|
978
|
-
inspect: () => {
|
|
979
|
-
return {
|
|
980
|
-
ressourceMap,
|
|
981
|
-
ressourceRedirectionMap,
|
|
982
|
-
}
|
|
983
|
-
},
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
const asFileNameWithoutHash = (fileName) => {
|
|
988
|
-
return fileName.replace(/_[a-z0-9]{8,}(\..*?)?$/, (_, afterHash = "") => {
|
|
989
|
-
return afterHash
|
|
990
|
-
})
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
// const preredirectUrlFromRessource = (ressource, ressourceRedirectionMap) => {
|
|
994
|
-
// const ressourceUrlPreRedirect = Object.keys(ressourceRedirectionMap).find(
|
|
995
|
-
// (urlPreRedirect) =>
|
|
996
|
-
// ressourceRedirectionMap[urlPreRedirect] === ressource.url,
|
|
997
|
-
// )
|
|
998
|
-
// return ressourceUrlPreRedirect
|
|
999
|
-
// }
|
|
1000
|
-
|
|
1001
|
-
export const referenceToCodeForRollup = (reference) => {
|
|
1002
|
-
const ressource = reference.ressource
|
|
1003
|
-
if (ressource.isInline) {
|
|
1004
|
-
return getRessourceAsBase64Url(ressource)
|
|
1005
|
-
}
|
|
1006
|
-
|
|
1007
|
-
return `import.meta.ROLLUP_FILE_URL_${ressource.rollupReferenceId}`
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
// const targetFileNameFromBuildManifest = (buildManifest, buildRelativeUrl) => {
|
|
1011
|
-
// const key = Object.keys(buildManifest).find((keyCandidate) => {
|
|
1012
|
-
// return buildManifest[keyCandidate] === buildRelativeUrl
|
|
1013
|
-
// })
|
|
1014
|
-
// return buildManifest[key]
|
|
1015
|
-
// }
|
|
1016
|
-
|
|
1017
|
-
const createRessourceTrace = ({
|
|
1018
|
-
ressource,
|
|
1019
|
-
createUrlSiteFromReference,
|
|
1020
|
-
findRessourceByUrl,
|
|
1021
|
-
}) => {
|
|
1022
|
-
// we could pass a way to build the import trace
|
|
1023
|
-
// it can be deduced by starting with the firstStrongReference
|
|
1024
|
-
// and trying to get a ressource for that reference
|
|
1025
|
-
// to get an other firstStrongReference
|
|
1026
|
-
// everytime we could build the sourcelocation
|
|
1027
|
-
// but for importer after the first once just line and column are enough
|
|
1028
|
-
// the source code would be too much
|
|
1029
|
-
|
|
1030
|
-
const { firstStrongReference } = ressource
|
|
1031
|
-
const trace = [createUrlSiteFromReference(firstStrongReference)]
|
|
1032
|
-
|
|
1033
|
-
const next = (reference) => {
|
|
1034
|
-
const referenceRessource = findRessourceByUrl(reference.referenceUrl)
|
|
1035
|
-
if (!referenceRessource) {
|
|
1036
|
-
return
|
|
1037
|
-
}
|
|
1038
|
-
const { firstStrongReference } = referenceRessource
|
|
1039
|
-
if (!firstStrongReference) {
|
|
1040
|
-
return
|
|
1041
|
-
}
|
|
1042
|
-
// ignore the programmatic reference
|
|
1043
|
-
if (firstStrongReference.isProgrammatic) {
|
|
1044
|
-
return
|
|
1045
|
-
}
|
|
1046
|
-
trace.push(createUrlSiteFromReference(firstStrongReference))
|
|
1047
|
-
next(firstStrongReference)
|
|
1048
|
-
}
|
|
1049
|
-
next(firstStrongReference)
|
|
1050
|
-
|
|
1051
|
-
return trace
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
const removePotentialUrlHash = (url) => {
|
|
1055
|
-
const urlObject = new URL(url)
|
|
1056
|
-
urlObject.hash = ""
|
|
1057
|
-
return String(urlObject)
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
/*
|
|
1061
|
-
* We cannot reference js from asset (svg for example)
|
|
1062
|
-
* that is because rollup awaits for html to be ready which waits
|
|
1063
|
-
* fetch and parse its dependencies (let's say an svg)
|
|
1064
|
-
* which waits for js to be fetched and parsed
|
|
1065
|
-
* but the fetching + parsing of js happens in rollup
|
|
1066
|
-
* so rollup would end up waiting forever
|
|
1067
|
-
*
|
|
1068
|
-
* see also:
|
|
1069
|
-
* - https://rollupjs.org/guide/en/#thisemitfileemittedfile-emittedchunk--emittedasset--string
|
|
1070
|
-
* - https://github.com/rollup/rollup/issues/2872
|
|
1071
|
-
*/
|
|
1072
|
-
const referenceShouldBeIgnoredWarning = ({
|
|
1073
|
-
isJsModule,
|
|
1074
|
-
ressourceImporter,
|
|
1075
|
-
ressourceSpecifier,
|
|
1076
|
-
referenceUrl,
|
|
1077
|
-
urlToHumanUrl,
|
|
1078
|
-
}) => {
|
|
1079
|
-
if (!isJsModule) {
|
|
1080
|
-
return false
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
// js can reference js
|
|
1084
|
-
if (ressourceImporter.isJsModule) {
|
|
1085
|
-
return false
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
// entry point can reference js (html)
|
|
1089
|
-
if (ressourceImporter.isEntryPoint) {
|
|
1090
|
-
return false
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
return `
|
|
1094
|
-
WARNING: Ignoring reference to ${urlToHumanUrl(
|
|
1095
|
-
ressourceSpecifier,
|
|
1096
|
-
)} found inside ${urlToHumanUrl(referenceUrl)}.
|
|
1097
|
-
`
|
|
1098
|
-
}
|