@module-federation/node 0.0.1 → 0.2.0

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.
Files changed (32) hide show
  1. package/README.md +43 -6
  2. package/package.json +16 -6
  3. package/src/index.d.ts +3 -0
  4. package/src/index.js +13 -0
  5. package/src/index.js.map +1 -0
  6. package/src/plugins/CommonJsChunkLoadingPlugin.d.ts +16 -0
  7. package/src/plugins/CommonJsChunkLoadingPlugin.js +83 -0
  8. package/src/plugins/CommonJsChunkLoadingPlugin.js.map +1 -0
  9. package/src/plugins/LoadFileChunkLoadingRuntimeModule.d.ts +29 -0
  10. package/src/plugins/LoadFileChunkLoadingRuntimeModule.js +333 -0
  11. package/src/plugins/LoadFileChunkLoadingRuntimeModule.js.map +1 -0
  12. package/src/plugins/NodeFederationPlugin.d.ts +16 -0
  13. package/src/plugins/NodeFederationPlugin.js +225 -0
  14. package/src/plugins/NodeFederationPlugin.js.map +1 -0
  15. package/src/plugins/StreamingTargetPlugin.d.ts +11 -0
  16. package/src/plugins/StreamingTargetPlugin.js +41 -0
  17. package/src/plugins/StreamingTargetPlugin.js.map +1 -0
  18. package/src/plugins/UniversalFederationPlugin.d.ts +16 -0
  19. package/src/plugins/UniversalFederationPlugin.js +26 -0
  20. package/src/plugins/UniversalFederationPlugin.js.map +1 -0
  21. package/src/plugins/loadScript.d.ts +6 -0
  22. package/src/{loadScript.js → plugins/loadScript.js} +4 -2
  23. package/src/plugins/loadScript.js.map +1 -0
  24. package/src/types/index.d.ts +3 -0
  25. package/src/types/index.js +3 -0
  26. package/src/types/index.js.map +1 -0
  27. package/LICENSE +0 -21
  28. package/index.js +0 -5
  29. package/src/CommonJsChunkLoadingPlugin.js +0 -89
  30. package/src/LoadFileChunkLoadingRuntimeModule.js +0 -410
  31. package/src/NodeFederationPlugin.js +0 -245
  32. package/src/StreamingTargetPlugin.js +0 -42
@@ -1,42 +0,0 @@
1
- const CommonJsChunkLoadingPlugin = require('./CommonJsChunkLoadingPlugin');
2
-
3
- class StreamingTargetPlugin {
4
- constructor(options, context) {
5
- this.options = options || {};
6
- this.context = context || {};
7
- }
8
-
9
- apply(compiler) {
10
- if (compiler.options.target) {
11
- console.warn(
12
- `target should be set to false while using NodeSoftwareStreamRuntime plugin, actual target: ${compiler.options.target}`
13
- );
14
- }
15
-
16
- // When used with Next.js, context is needed to use Next.js webpack
17
- const { webpack } = compiler;
18
-
19
- // This will enable CommonJsChunkFormatPlugin
20
- compiler.options.output.chunkFormat = 'commonjs';
21
- // This will force async chunk loading
22
- compiler.options.output.chunkLoading = 'async-node';
23
- // Disable default config
24
- compiler.options.output.enabledChunkLoadingTypes = false;
25
-
26
- new ((webpack && webpack.node && webpack.node.NodeEnvironmentPlugin) ||
27
- require('webpack/lib/node/NodeEnvironmentPlugin'))({
28
- infrastructureLogging: compiler.options.infrastructureLogging,
29
- }).apply(compiler);
30
- new ((webpack && webpack.node && webpack.node.NodeTargetPlugin) ||
31
- require('webpack/lib/node/NodeTargetPlugin'))().apply(compiler);
32
- new CommonJsChunkLoadingPlugin({
33
- asyncChunkLoading: true,
34
- name: this.options.name,
35
- remotes: this.options.remotes,
36
- baseURI: compiler.options.output.publicPath, //TODO: should remove?
37
- promiseBaseURI: this.options.promiseBaseURI, //TODO: should remove?
38
- }).apply(compiler);
39
- }
40
- }
41
-
42
- module.exports = StreamingTargetPlugin;