Skip to content

Commit 76cf320

Browse files
authored
fix: immediately inject global runtime plugins (module-federation#3318)
1 parent 8165419 commit 76cf320

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

.changeset/great-glasses-retire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@module-federation/devtools': patch
3+
---
4+
5+
fix: immediately inject global runtime plugins

packages/chrome-devtools/manifest.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
"resources": [
1717
"static/js/post-message.js",
1818
"static/js/post-message-start.js",
19-
"static/js/fast-refresh-init.js",
2019
"static/js/fast-refresh.js",
21-
"static/js/snapshot-plugin-init.js",
2220
"static/js/snapshot-plugin.js"
2321
],
2422
"matches": ["<all_urls>"]
@@ -31,11 +29,15 @@
3129
"matches": ["<all_urls>"],
3230
"js": [
3331
"static/js/post-message-init.js",
34-
"static/js/post-message-listener.js",
35-
"static/js/fast-refresh-init.js",
36-
"static/js/snapshot-plugin-init.js"
32+
"static/js/post-message-listener.js"
3733
],
3834
"run_at": "document_start"
35+
},
36+
{
37+
"matches": ["<all_urls>"],
38+
"js": ["static/js/fast-refresh.js", "static/js/snapshot-plugin.js"],
39+
"world": "MAIN",
40+
"run_at": "document_start"
3941
}
4042
],
4143
"background": {

packages/chrome-devtools/modern.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ export default defineConfig({
2323
if (process.env.E2ETEST) {
2424
config.entry.worker = './src/worker/index.ts';
2525
}
26-
config.entry['fast-refresh-init'] =
27-
'./src/utils/chrome/fast-refresh-init.ts';
2826
config.entry['fast-refresh'] = './src/utils/chrome/fast-refresh.ts';
29-
config.entry['snapshot-plugin-init'] =
30-
'./src/utils/chrome/snapshot-plugin-init.ts';
3127
config.entry['snapshot-plugin'] = './src/utils/chrome/snapshot-plugin.ts';
3228
config.entry['post-message'] = './src/utils/chrome/post-message.ts';
3329
config.entry['post-message-init'] =

packages/chrome-devtools/project.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"commands": ["npm run build:lib --prefix packages/chrome-devtools"]
1212
}
1313
},
14+
"build:chrome-plugins": {
15+
"executor": "nx:run-commands",
16+
"options": {
17+
"commands": ["npm run build --prefix packages/chrome-devtools"]
18+
}
19+
},
1420
"test": {
1521
"executor": "nx:run-commands",
1622
"options": {

packages/chrome-devtools/src/utils/chrome/fast-refresh-init.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/chrome-devtools/src/utils/chrome/snapshot-plugin-init.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)