@genesislcap/webpack-builder 14.226.2-alpha-ee50d0d.0 → 14.227.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":"devServer.d.ts","sourceRoot":"","sources":["../../src/config/devServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAqB7C,eAAO,MAAM,SAAS,QAAS,YAAY,KAAG,aAAa,CAAC,WAAW,CA6CtE,CAAC"}
1
+ {"version":3,"file":"devServer.d.ts","sourceRoot":"","sources":["../../src/config/devServer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAO3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAqB7C,eAAO,MAAM,SAAS,QAAS,YAAY,KAAG,aAAa,CAAC,WAAW,CA+CtE,CAAC"}
@@ -22,15 +22,17 @@ const getServer = (isHTTPS = false) => {
22
22
  };
23
23
  };
24
24
  const devServer = (ctx) => {
25
- var _a;
26
25
  const { cli: { isDev, options: { open, https }, }, dirs: { cwd }, env: { isCI }, pkg, config: { webpack }, } = ctx;
27
26
  if (!isDev) {
28
27
  return;
29
28
  }
30
- const publicPath = (_a = process.env.PUBLIC_PATH) !== null && _a !== void 0 ? _a : '/';
31
29
  return {
32
- open: open && !isCI,
33
- historyApiFallback: true,
30
+ open: open && !isCI ? (0, build_kit_1.getPublicPath)() : false,
31
+ historyApiFallback: process.env.PUBLIC_PATH
32
+ ? {
33
+ rewrites: [{ from: /./, to: `${(0, build_kit_1.getPublicPath)()}/index.html` }],
34
+ }
35
+ : true,
34
36
  allowedHosts: 'all',
35
37
  host: '0.0.0.0',
36
38
  port: (0, build_kit_1.getPort)(pkg),
@@ -49,7 +51,7 @@ const devServer = (ctx) => {
49
51
  static: [
50
52
  {
51
53
  directory: (0, node_path_1.resolve)(cwd, './public'),
52
- publicPath,
54
+ publicPath: (0, build_kit_1.getPublicPath)(),
53
55
  watch: true,
54
56
  },
55
57
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"federation.d.ts","sourceRoot":"","sources":["../../src/config/federation.ts"],"names":[],"mappings":"AAGA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,KAAK,6BAA6B,GAAG,qBAAqB,CACxD,OAAO,SAAS,CAAC,sBAAsB,CACxC,CAAC,CAAC,CAAC,CAAC;AAIL,eAAO,MAAM,mBAAmB,uBAM/B,CAAC;AAIF,eAAO,MAAM,qBAAqB,cAA+C,CAAC;AAElF,eAAO,MAAM,oBAAoB,eAGhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,sCACmB,CAAC;AAElD,eAAO,MAAM,cAAc,iDACiB,CAAC;AAE7C,eAAO,MAAM,wBAAwB,YAC1B,6BAA6B,OACjC,WAAW,KACf,6BAoBF,CAAC;AAEF,eAAO,MAAM,oBAAoB,0BACR,OAAO,eACjB,MAAM,WACV,6BAA6B,OACjC,WAAW,6DAeV,CAAC"}
1
+ {"version":3,"file":"federation.d.ts","sourceRoot":"","sources":["../../src/config/federation.ts"],"names":[],"mappings":"AAIA,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGpC,KAAK,6BAA6B,GAAG,qBAAqB,CACxD,OAAO,SAAS,CAAC,sBAAsB,CACxC,CAAC,CAAC,CAAC,CAAC;AAIL,eAAO,MAAM,mBAAmB,uBAM/B,CAAC;AAIF,eAAO,MAAM,qBAAqB,cAA+C,CAAC;AAElF,eAAO,MAAM,oBAAoB,eAGhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,iBAAiB,sCACmB,CAAC;AAElD,eAAO,MAAM,cAAc,iDACiB,CAAC;AAE7C,eAAO,MAAM,wBAAwB,YAC1B,6BAA6B,OACjC,WAAW,KACf,6BAoBF,CAAC;AAEF,eAAO,MAAM,oBAAoB,0BACR,OAAO,eACjB,MAAM,WACV,6BAA6B,OACjC,WAAW,6DAgBV,CAAC"}
@@ -4,6 +4,7 @@ exports.getFederationPlugins = exports.resolveFederationOptions = exports.getRem
4
4
  const tslib_1 = require("tslib");
5
5
  const node_fs_1 = require("node:fs");
6
6
  const node_path_1 = require("node:path");
7
+ const build_kit_1 = require("@genesislcap/build-kit");
7
8
  const camel_case_1 = require("camel-case");
8
9
  const html_webpack_plugin_1 = tslib_1.__importDefault(require("html-webpack-plugin"));
9
10
  const webpack_1 = require("webpack");
@@ -56,6 +57,7 @@ const getFederationPlugins = (federatedIndexPresent, rootElement, options, pkg)
56
57
  // Passing arbitrary data to the template for display
57
58
  moduleFederationDetails: JSON.stringify(options, undefined, 2),
58
59
  minify: false,
60
+ base: (0, build_kit_1.getPublicPath)(),
59
61
  }),
60
62
  new ModuleFederationPlugin(options),
61
63
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/config/output.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAqB7C,eAAO,MAAM,MAAM,QAAS,YAAY,KAAG,aAAa,CAAC,QAAQ,CAiBhE,CAAC"}
1
+ {"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/config/output.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAoB,MAAM,wBAAwB,CAAC;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAc7C,eAAO,MAAM,MAAM,QAAS,YAAY,KAAG,aAAa,CAAC,QAAQ,CAiBhE,CAAC"}
@@ -2,12 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.output = void 0;
4
4
  const node_path_1 = require("node:path");
5
- /**
6
- * Switching the '/' instead of 'auto', as webpack and perhaps the html-webpack-plugin seem to get confused over
7
- * mime types, and this can block deep linking. Reading through the 'Practical Module Federation' guide, we may need
8
- * to revisit this, dev v prod, resolving remotes.
9
- */
10
- const publicPath = typeof process.env.PUBLIC_PATH !== 'undefined' ? process.env.PUBLIC_PATH : '/';
5
+ const build_kit_1 = require("@genesislcap/build-kit");
11
6
  const defaultGetters = {
12
7
  file: ({ isDev }) => (isDev ? '[name].js' : '[name].[contenthash].js'),
13
8
  chunk: ({ isDev }) => (isDev ? '[name].[id].js' : '[name].[id].[contenthash].js'),
@@ -25,7 +20,7 @@ const output = (ctx) => {
25
20
  strictModuleErrorHandling: true,
26
21
  strictModuleExceptionHandling: true,
27
22
  path: (0, node_path_1.resolve)(cwd, './dist'),
28
- publicPath,
23
+ publicPath: (0, build_kit_1.getPublicPath)(),
29
24
  filename: getters.file({ isDev }),
30
25
  chunkFilename: getters.chunk({ isDev }),
31
26
  sourceMapFilename: getters.sourceMap({ isDev }),
@@ -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;AAM3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiB7C,eAAO,MAAM,OAAO,QAAS,YAAY,KAAG,aAAa,CAAC,SAAS,CA6ElE,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;AAM3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAiB7C,eAAO,MAAM,OAAO,QAAS,YAAY,KAAG,aAAa,CAAC,SAAS,CA8ElE,CAAC"}
@@ -58,6 +58,7 @@ const plugins = (ctx) => {
58
58
  template: getTemplate(cwd),
59
59
  customElementTagName: rootElement,
60
60
  minify: false,
61
+ base: (0, build_kit_1.getPublicPath)(),
61
62
  }),
62
63
  ...(0, federation_1.getFederationPlugins)(federatedIndexPresent, rootElement, moduleFederationOptions, pkg),
63
64
  isAnalyze &&
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/webpack-builder",
3
3
  "description": "Webpack builder",
4
- "version": "14.226.2-alpha-ee50d0d.0",
4
+ "version": "14.227.0",
5
5
  "license": "SEE LICENSE IN license.txt",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "dev": "tsc -b ./tsconfig.json -w"
16
16
  },
17
17
  "dependencies": {
18
- "@genesislcap/build-kit": "14.226.2-alpha-ee50d0d.0",
18
+ "@genesislcap/build-kit": "14.227.0",
19
19
  "@pixability-ui/federated-types": "^0.2.0",
20
20
  "@types/webpack-env": "^1.18.4",
21
21
  "camel-case": "^4.1.2",
@@ -57,5 +57,5 @@
57
57
  "publishConfig": {
58
58
  "access": "public"
59
59
  },
60
- "gitHead": "0cf87047a4d98e207401dd144a7ecdaabd54bc9d"
60
+ "gitHead": "6f1749b0cb8e0093efe528bc44a34eeb0697f458"
61
61
  }
@@ -1,6 +1,11 @@
1
1
  import { resolve } from 'node:path';
2
2
  import type { BuildContext } from '@genesislcap/build-kit';
3
- import { createDevProxiesArray, getDevCertOptions, getPort } from '@genesislcap/build-kit';
3
+ import {
4
+ createDevProxiesArray,
5
+ getDevCertOptions,
6
+ getPort,
7
+ getPublicPath,
8
+ } from '@genesislcap/build-kit';
4
9
  import type { Configuration } from 'webpack';
5
10
 
6
11
  const getServer = (isHTTPS = false) => {
@@ -38,11 +43,13 @@ export const devServer = (ctx: BuildContext): Configuration['devServer'] => {
38
43
  return;
39
44
  }
40
45
 
41
- const publicPath = process.env.PUBLIC_PATH ?? '/';
42
-
43
46
  return {
44
- open: open && !isCI,
45
- historyApiFallback: true,
47
+ open: open && !isCI ? getPublicPath() : false,
48
+ historyApiFallback: process.env.PUBLIC_PATH
49
+ ? {
50
+ rewrites: [{ from: /./, to: `${getPublicPath()}/index.html` }],
51
+ }
52
+ : true,
46
53
  allowedHosts: 'all',
47
54
  host: '0.0.0.0',
48
55
  port: getPort(pkg),
@@ -61,7 +68,7 @@ export const devServer = (ctx: BuildContext): Configuration['devServer'] => {
61
68
  static: [
62
69
  {
63
70
  directory: resolve(cwd, './public'),
64
- publicPath,
71
+ publicPath: getPublicPath(),
65
72
  watch: true,
66
73
  },
67
74
  ],
@@ -1,5 +1,6 @@
1
1
  import { existsSync } from 'node:fs';
2
2
  import { resolve } from 'node:path';
3
+ import { getPublicPath } from '@genesislcap/build-kit';
3
4
  import { camelCase } from 'camel-case';
4
5
  import HtmlWebpackPlugin from 'html-webpack-plugin';
5
6
  import { PackageJson } from 'pkg-types';
@@ -79,6 +80,7 @@ export const getFederationPlugins = (
79
80
  // Passing arbitrary data to the template for display
80
81
  moduleFederationDetails: JSON.stringify(options, undefined, 2),
81
82
  minify: false,
83
+ base: getPublicPath(),
82
84
  }),
83
85
  new ModuleFederationPlugin(options),
84
86
  ]
@@ -1,15 +1,8 @@
1
1
  import { resolve } from 'node:path';
2
- import type { BuildContext } from '@genesislcap/build-kit';
3
- import type { WebpackFilenames } from '@genesislcap/build-kit';
2
+ import type { BuildContext, WebpackFilenames } from '@genesislcap/build-kit';
3
+ import { getPublicPath } from '@genesislcap/build-kit';
4
4
  import type { Configuration } from 'webpack';
5
5
 
6
- /**
7
- * Switching the '/' instead of 'auto', as webpack and perhaps the html-webpack-plugin seem to get confused over
8
- * mime types, and this can block deep linking. Reading through the 'Practical Module Federation' guide, we may need
9
- * to revisit this, dev v prod, resolving remotes.
10
- */
11
- const publicPath = typeof process.env.PUBLIC_PATH !== 'undefined' ? process.env.PUBLIC_PATH : '/';
12
-
13
6
  const defaultGetters: WebpackFilenames = {
14
7
  file: ({ isDev }) => (isDev ? '[name].js' : '[name].[contenthash].js'),
15
8
  chunk: ({ isDev }) => (isDev ? '[name].[id].js' : '[name].[id].[contenthash].js'),
@@ -34,7 +27,7 @@ export const output = (ctx: BuildContext): Configuration['output'] => {
34
27
  strictModuleErrorHandling: true,
35
28
  strictModuleExceptionHandling: true,
36
29
  path: resolve(cwd, './dist'),
37
- publicPath,
30
+ publicPath: getPublicPath(),
38
31
  filename: getters.file({ isDev }),
39
32
  chunkFilename: getters.chunk({ isDev }),
40
33
  sourceMapFilename: getters.sourceMap({ isDev }),
@@ -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, resolveDefineConfig } from '@genesislcap/build-kit';
4
+ import { getPublicPath, objToSnakeCase, resolveDefineConfig } from '@genesislcap/build-kit';
5
5
  import CircularDependencyPlugin from 'circular-dependency-plugin';
6
6
  import CopyPlugin from 'copy-webpack-plugin';
7
7
  import HtmlWebpackPlugin from 'html-webpack-plugin';
@@ -72,6 +72,7 @@ export const plugins = (ctx: BuildContext): Configuration['plugins'] => {
72
72
  template: getTemplate(cwd),
73
73
  customElementTagName: rootElement,
74
74
  minify: false,
75
+ base: getPublicPath(),
75
76
  }),
76
77
  ...getFederationPlugins(federatedIndexPresent, rootElement, moduleFederationOptions, pkg),
77
78
  isAnalyze &&