@genesislcap/webpack-builder 14.40.1 → 14.41.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.
@@ -1 +1 @@
1
- {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/config/plugins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAK3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiB7C,eAAO,MAAM,OAAO,QAAS,YAAY,KAAG,aAAa,CAAC,SAAS,CAsElE,CAAC"}
1
+ {"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/config/plugins.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAK3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAgB7C,eAAO,MAAM,OAAO,QAAS,YAAY,KAAG,aAAa,CAAC,SAAS,CAgElE,CAAC"}
@@ -13,7 +13,6 @@ const webpack_bundle_analyzer_1 = require("webpack-bundle-analyzer");
13
13
  const webpack_pwa_manifest_1 = tslib_1.__importDefault(require("webpack-pwa-manifest"));
14
14
  const webpackbar_1 = tslib_1.__importDefault(require("webpackbar"));
15
15
  const workbox_webpack_plugin_1 = require("workbox-webpack-plugin");
16
- const utils_1 = require("../utils");
17
16
  const federation_1 = require("./federation");
18
17
  const getTemplate = (cwd) => {
19
18
  const templateApp = (0, node_path_1.resolve)(cwd, 'public/index.ejs');
@@ -23,9 +22,10 @@ const getTemplate = (cwd) => {
23
22
  return template;
24
23
  };
25
24
  const plugins = (ctx) => {
26
- const { cli: { isAnalyze }, dirs: { cwd }, config: { serviceWorker, pwa, federation, app: { rootElement }, }, pkg, } = ctx;
25
+ const { cli: { isAnalyze }, dirs: { cwd }, config: { serviceWorker, pwa, federation, app: { rootElement }, http, env, }, pkg, } = ctx;
27
26
  const federatedIndexPresent = (0, federation_1.federatedIndexExists)();
28
27
  const moduleFederationOptions = (0, federation_1.resolveFederationOptions)(federation, pkg);
28
+ const define = (0, build_kit_1.resolveDefineConfig)(env, http);
29
29
  return [
30
30
  new copy_webpack_plugin_1.default({
31
31
  patterns: [
@@ -34,16 +34,7 @@ const plugins = (ctx) => {
34
34
  },
35
35
  ],
36
36
  }),
37
- new webpack_1.DefinePlugin({
38
- API_HOST: JSON.stringify(process.env.API_HOST),
39
- DEFAULT_ORGANISATION: JSON.stringify(process.env.DEFAULT_ORGANISATION),
40
- DEFAULT_USER: JSON.stringify(process.env.DEFAULT_USER),
41
- DEFAULT_PASSWORD: JSON.stringify(process.env.DEFAULT_PASSWORD),
42
- NODE_ENV: JSON.stringify(process.env.NODE_ENV),
43
- FORCE_HTTP: JSON.stringify(process.env.FORCE_HTTP),
44
- HTTP_CONFIG: JSON.stringify((0, utils_1.readFile)(process.env.HTTP_CONFIG_PATH)),
45
- SOCKET_EXT: JSON.stringify(process.env.SOCKET_EXT),
46
- }),
37
+ new webpack_1.DefinePlugin(define),
47
38
  new webpackbar_1.default(),
48
39
  new mini_css_extract_plugin_1.default(),
49
40
  (rootElement || !federatedIndexPresent) &&
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/webpack-builder",
3
3
  "description": "Webpack builder",
4
- "version": "14.40.1",
4
+ "version": "14.41.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  "dev": "tsc -b ./tsconfig.json -w"
13
13
  },
14
14
  "dependencies": {
15
- "@genesislcap/build-kit": "^14.40.1",
15
+ "@genesislcap/build-kit": "^14.41.0",
16
16
  "@module-federation/dashboard-plugin": "2.6.5",
17
17
  "@pixability-ui/federated-types": "^0.2.0",
18
18
  "camel-case": "^4.1.2",
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "b2f957496de6a98f8221da5c72ab9a1b6d6ea74b"
56
+ "gitHead": "98799a829ab05cf534ddcfac6e41b0244538d0ab"
57
57
  }
@@ -1,7 +1,7 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { resolve, join } from 'node:path';
3
3
  import type { BuildContext } from '@genesislcap/build-kit';
4
- import { objToSnakeCase } from '@genesislcap/build-kit';
4
+ import { objToSnakeCase, resolveDefineConfig } from '@genesislcap/build-kit';
5
5
  import CopyPlugin from 'copy-webpack-plugin';
6
6
  import HtmlWebpackPlugin from 'html-webpack-plugin';
7
7
  import MiniCssExtractPlugin from 'mini-css-extract-plugin';
@@ -11,7 +11,6 @@ import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer';
11
11
  import WebpackPwaManifest from 'webpack-pwa-manifest';
12
12
  import WebpackBar from 'webpackbar';
13
13
  import { InjectManifest } from 'workbox-webpack-plugin';
14
- import { readFile } from '../utils';
15
14
  import { getFederationPlugins, federatedIndexExists, resolveFederationOptions } from './federation';
16
15
 
17
16
  const getTemplate = (cwd) => {
@@ -31,12 +30,15 @@ export const plugins = (ctx: BuildContext): Configuration['plugins'] => {
31
30
  pwa,
32
31
  federation,
33
32
  app: { rootElement },
33
+ http,
34
+ env,
34
35
  },
35
36
  pkg,
36
37
  } = ctx;
37
38
 
38
39
  const federatedIndexPresent = federatedIndexExists();
39
40
  const moduleFederationOptions = resolveFederationOptions(federation, pkg);
41
+ const define = resolveDefineConfig(env, http);
40
42
 
41
43
  return [
42
44
  new CopyPlugin({
@@ -46,16 +48,7 @@ export const plugins = (ctx: BuildContext): Configuration['plugins'] => {
46
48
  },
47
49
  ],
48
50
  }),
49
- new DefinePlugin({
50
- API_HOST: JSON.stringify(process.env.API_HOST),
51
- DEFAULT_ORGANISATION: JSON.stringify(process.env.DEFAULT_ORGANISATION),
52
- DEFAULT_USER: JSON.stringify(process.env.DEFAULT_USER),
53
- DEFAULT_PASSWORD: JSON.stringify(process.env.DEFAULT_PASSWORD),
54
- NODE_ENV: JSON.stringify(process.env.NODE_ENV),
55
- FORCE_HTTP: JSON.stringify(process.env.FORCE_HTTP),
56
- HTTP_CONFIG: JSON.stringify(readFile(process.env.HTTP_CONFIG_PATH)),
57
- SOCKET_EXT: JSON.stringify(process.env.SOCKET_EXT),
58
- }),
51
+ new DefinePlugin(define),
59
52
  new WebpackBar(),
60
53
  new MiniCssExtractPlugin(),
61
54
  (rootElement || !federatedIndexPresent) &&
@@ -1,2 +0,0 @@
1
- export declare const readFile: (filePath: any) => string;
2
- //# sourceMappingURL=fs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/utils/fs.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,2BASpB,CAAC"}
package/dist/utils/fs.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readFile = void 0;
4
- const node_fs_1 = require("node:fs");
5
- const node_path_1 = require("node:path");
6
- const readFile = (filePath) => {
7
- if (!filePath)
8
- return '';
9
- const resolvedPath = (0, node_path_1.resolve)(process.cwd(), filePath);
10
- try {
11
- return (0, node_fs_1.readFileSync)(resolvedPath, 'utf8');
12
- }
13
- catch (e) {
14
- console.error(e);
15
- return '';
16
- }
17
- };
18
- exports.readFile = readFile;
@@ -1,2 +0,0 @@
1
- export * from './fs';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC"}
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./fs"), exports);
package/src/utils/fs.ts DELETED
@@ -1,13 +0,0 @@
1
- import { readFileSync } from 'node:fs';
2
- import { resolve } from 'node:path';
3
-
4
- export const readFile = (filePath) => {
5
- if (!filePath) return '';
6
- const resolvedPath = resolve(process.cwd(), filePath);
7
- try {
8
- return readFileSync(resolvedPath, 'utf8');
9
- } catch (e) {
10
- console.error(e);
11
- return '';
12
- }
13
- };
@@ -1 +0,0 @@
1
- export * from './fs';