@jsenv/core 41.0.3 → 41.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build/build.js +38 -44
- package/dist/start_dev_server/jsenv_core_packages.js +2213 -2213
- package/dist/start_dev_server/start_dev_server.js +9264 -9186
- package/package.json +3 -3
- package/src/{plugins/chrome_devtools_json/jsenv_plugin_chrome_devtools_json.js → dev/dev_server_plugins/dev_server_plugin_chrome_devtools_json.js} +4 -6
- package/src/dev/dev_server_plugins/dev_server_plugin_inject_server_response_header.js +27 -0
- package/src/dev/dev_server_plugins/dev_server_plugin_omega_error_handler.js +44 -0
- package/src/dev/dev_server_plugins/dev_server_plugin_serve_source_files.js +410 -0
- package/src/dev/start_dev_server.js +90 -521
- package/src/plugins/directory_reference_effect/jsenv_plugin_directory_reference_effect.js +7 -2
- package/src/plugins/global_scenarios/jsenv_plugin_global_scenarios.js +8 -0
- package/src/plugins/import_meta_css/jsenv_plugin_import_meta_css.js +8 -0
- package/src/plugins/import_meta_hot/jsenv_plugin_import_meta_hot.js +8 -0
- package/src/plugins/import_meta_scenarios/jsenv_plugin_import_meta_scenarios.js +8 -0
- package/src/plugins/plugins.js +0 -2
- /package/src/dev/{user_agent.js → dev_server_plugins/user_agent.js} +0 -0
|
@@ -9,6 +9,14 @@ import { INJECTIONS } from "../../kitchen/url_graph/url_info_injections.js";
|
|
|
9
9
|
|
|
10
10
|
export const jsenvPluginGlobalScenarios = () => {
|
|
11
11
|
const transformIfNeeded = (urlInfo) => {
|
|
12
|
+
// Do not scan node modules for __DEV__/__BUILD__
|
|
13
|
+
// - node modules won't have this in their code
|
|
14
|
+
// - ;or should use other an other technic as this one won't be available
|
|
15
|
+
// They would be discarded by content.includes detection
|
|
16
|
+
// but it's cheaper to detect by URL than to scan potentially large files
|
|
17
|
+
if (urlInfo.url.includes("/node_modules/")) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
12
20
|
return {
|
|
13
21
|
contentInjections: {
|
|
14
22
|
__DEV__: INJECTIONS.optional(urlInfo.context.dev),
|
|
@@ -36,6 +36,14 @@ export const jsenvPluginImportMetaCss = () => {
|
|
|
36
36
|
appliesDuring: "*",
|
|
37
37
|
transformUrlContent: {
|
|
38
38
|
js_module: async (urlInfo) => {
|
|
39
|
+
// Do not scan node modules for import.meta.css
|
|
40
|
+
// - unlikely to be there
|
|
41
|
+
// - we don't watch node modules (too expensive)
|
|
42
|
+
// They would be discarded by content.includes detection
|
|
43
|
+
// but it's cheaper to detect by URL than to scan potentially large files
|
|
44
|
+
if (urlInfo.url.includes("/node_modules/")) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
39
47
|
if (!urlInfo.content.includes("import.meta.css")) {
|
|
40
48
|
return null;
|
|
41
49
|
}
|
|
@@ -53,6 +53,14 @@ export const jsenvPluginImportMetaHot = () => {
|
|
|
53
53
|
cssUrlInfo.data.hotAcceptDependencies = [];
|
|
54
54
|
},
|
|
55
55
|
js_module: async (urlInfo) => {
|
|
56
|
+
// Do not scan node modules for import.meta.hot
|
|
57
|
+
// - unlikely to be there
|
|
58
|
+
// - we don't watch node modules (too expensive)
|
|
59
|
+
// They would be discarded by content.includes detection
|
|
60
|
+
// but it's cheaper to detect by URL than to scan potentially large files
|
|
61
|
+
if (urlInfo.url.includes("/node_modules/")) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
56
64
|
if (!urlInfo.content.includes("import.meta.hot")) {
|
|
57
65
|
return null;
|
|
58
66
|
}
|
|
@@ -19,6 +19,14 @@ export const jsenvPluginImportMetaScenarios = () => {
|
|
|
19
19
|
appliesDuring: "*",
|
|
20
20
|
transformUrlContent: {
|
|
21
21
|
js_module: async (urlInfo) => {
|
|
22
|
+
// Do not scan node modules for import.meta.dev/import.meta.build
|
|
23
|
+
// - node modules won't have this in their code
|
|
24
|
+
// - ;or should use other an other technic as this one won't be available
|
|
25
|
+
// They would be discarded by content.includes detection
|
|
26
|
+
// but it's cheaper to detect by URL than to scan potentially large files
|
|
27
|
+
if (urlInfo.url.includes("/node_modules/")) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
22
30
|
if (
|
|
23
31
|
!urlInfo.content.includes("import.meta.dev") &&
|
|
24
32
|
!urlInfo.content.includes("import.meta.test") &&
|
package/src/plugins/plugins.js
CHANGED
|
@@ -25,7 +25,6 @@ import { jsenvPluginCacheControl } from "./cache_control/jsenv_plugin_cache_cont
|
|
|
25
25
|
import { jsenvPluginRibbon } from "./ribbon/jsenv_plugin_ribbon.js";
|
|
26
26
|
import { jsenvPluginDropToOpen } from "./drop_to_open/jsenv_plugin_drop_to_open.js";
|
|
27
27
|
import { jsenvPluginCleanHTML } from "./clean_html/jsenv_plugin_clean_html.js";
|
|
28
|
-
import { jsenvPluginChromeDevtoolsJson } from "./chrome_devtools_json/jsenv_plugin_chrome_devtools_json.js";
|
|
29
28
|
import { jsenvPluginAutoreloadOnServerRestart } from "./autoreload_on_server_restart/jsenv_plugin_autoreload_on_server_restart.js";
|
|
30
29
|
import { jsenvPluginPackageSideEffects } from "./package_side_effects/jsenv_plugin_package_side_effects.js";
|
|
31
30
|
import { jsenvPluginWorkspaceBundle } from "./workspace_bundle/jsenv_plugin_workspace_bundle.js";
|
|
@@ -156,7 +155,6 @@ export const getCorePlugins = ({
|
|
|
156
155
|
...(ribbon ? [jsenvPluginRibbon({ rootDirectoryUrl, ...ribbon })] : []),
|
|
157
156
|
...(dropToOpen ? [jsenvPluginDropToOpen()] : []),
|
|
158
157
|
jsenvPluginCleanHTML(),
|
|
159
|
-
jsenvPluginChromeDevtoolsJson(),
|
|
160
158
|
...(packageSideEffects
|
|
161
159
|
? [jsenvPluginPackageSideEffects({ packageDirectory })]
|
|
162
160
|
: []),
|
|
File without changes
|