@kosdev-code/kos-nx-plugin 0.1.0-dev.5136 → 0.1.0-dev.5137

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosdev-code/kos-nx-plugin",
3
- "version": "0.1.0-dev.5136",
3
+ "version": "0.1.0-dev.5137",
4
4
  "type": "commonjs",
5
5
  "generators": "./generators.json",
6
6
  "publishConfig": {
@@ -19,7 +19,7 @@
19
19
  "main": "./src/index.js",
20
20
  "kos": {
21
21
  "build": {
22
- "gitHash": "3d191a55c24b91ebb7f4d3963bfe941e38dea436"
22
+ "gitHash": "6619478e87b019e339c3e13e8ebcee6bed8ce954"
23
23
  }
24
24
  }
25
25
  }
@@ -1,7 +1,26 @@
1
- import { withKosConfig } from '@kosdev-code/kos-ui-plugin/webpack';
2
- import { withReact } from '@nx/react';
3
- import { composePlugins, withNx } from '@nx/webpack';
4
- import * as webpack from 'webpack';
1
+ import { generatePluginConfiguration } from "@kosdev-code/kos-ui-plugin/utilities";
2
+ import { withKosConfig, withPluginDevServer } from "@kosdev-code/kos-ui-plugin/webpack";
3
+ import { withReact } from "@nx/react";
4
+ import { withModuleFederation } from "@nx/react/module-federation";
5
+ import { composePlugins, withNx } from "@nx/webpack";
6
+ import { readFileSync } from "fs";
7
+ import { join } from "path";
8
+ import * as webpack from "webpack";
5
9
 
6
- // Nx plugins for webpack to build config object from Nx options and context.
7
- export default composePlugins(withNx(), withReact({}), withKosConfig(webpack));
10
+ const kosConfig = JSON.parse(
11
+ readFileSync(join(__dirname, "./.kos.json"), "utf-8")
12
+ );
13
+ const baseConfig = generatePluginConfiguration(kosConfig);
14
+ const config = {
15
+ ...baseConfig,
16
+ };
17
+
18
+ export default composePlugins(
19
+ withNx(),
20
+ withReact({}),
21
+ withModuleFederation(config),
22
+ withKosConfig(webpack),
23
+ withPluginDevServer({
24
+ verbose: process.env.VERBOSE_PLUGIN_DEV === 'true'
25
+ })
26
+ );