@auto-mas/auto-mas-plugin-hmr 0.1.0 → 0.1.1
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.
|
@@ -37,6 +37,9 @@ export function isDevelopmentModule(path) {
|
|
|
37
37
|
export function isBuiltinDevelopmentModule(path) {
|
|
38
38
|
return isDevelopmentModule(path) && !path.split(/[/\\]/u).slice(0, -1).some(part => generatedDirectories.has(part.toLowerCase()));
|
|
39
39
|
}
|
|
40
|
+
function isWorkspaceDevelopmentModule(path) {
|
|
41
|
+
return isDevelopmentModule(path) && !path.split(/[/\\]/u).some(part => part.toLowerCase() === 'node_modules');
|
|
42
|
+
}
|
|
40
43
|
function inside(root, path) {
|
|
41
44
|
const tail = relative(root, path);
|
|
42
45
|
return tail !== '..' && !tail.startsWith(`..${sep}`) && !isAbsolute(tail);
|
|
@@ -55,6 +58,9 @@ export function createHmrFeature(sourceRoot, pluginRoot, hooks) {
|
|
|
55
58
|
},
|
|
56
59
|
} };
|
|
57
60
|
}
|
|
61
|
+
export function watchWorkspacePluginModules(root, hmr, hooks, logger) {
|
|
62
|
+
return watchPluginModules([{ path: root, accepts: isWorkspaceDevelopmentModule }], hmr, hooks, logger);
|
|
63
|
+
}
|
|
58
64
|
function watchPluginModules(roots, hmr, options, logger) {
|
|
59
65
|
const pending = new Set();
|
|
60
66
|
const retained = new Set();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@auto-mas/auto-mas-plugin-hmr",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -18,6 +18,14 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"description": "AUTO-MAS hmr Cordis component",
|
|
21
|
+
"mas": {
|
|
22
|
+
"hidden": false,
|
|
23
|
+
"category": "core",
|
|
24
|
+
"description": {
|
|
25
|
+
"zh": "在开发期间监听插件修改并热重载组件",
|
|
26
|
+
"en": "Watch plugin changes and hot-reload components during development"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
21
29
|
"autoMas": {
|
|
22
30
|
"id": "hmr",
|
|
23
31
|
"abi": 1,
|