@genesislcap/webpack-builder 14.70.4-es2021.1 → 14.70.4-test.1

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.
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.build = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const consola_1 = tslib_1.__importDefault(require("consola"));
6
- const build = async (compiler) => {
7
- const stats = await new Promise((success, error) => {
6
+ const build = (compiler) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
+ const stats = yield new Promise((success, error) => {
8
8
  compiler.run((err, result) => (err ? error(err) : success(result)));
9
9
  });
10
10
  if (stats.hasErrors()) {
@@ -20,5 +20,5 @@ const build = async (compiler) => {
20
20
  chunks: false,
21
21
  chunkModules: false,
22
22
  }) + '\n\n');
23
- };
23
+ });
24
24
  exports.build = build;
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.dev = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const webpack_dev_server_1 = tslib_1.__importDefault(require("webpack-dev-server"));
6
- const dev = async (compiler, config) => {
6
+ const dev = (compiler, config) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
7
  const server = new webpack_dev_server_1.default(config.devServer, compiler);
8
- await server.start();
9
- };
8
+ yield server.start();
9
+ });
10
10
  exports.dev = dev;
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const node_fs_1 = require("node:fs");
6
6
  const node_path_1 = require("node:path");
7
7
  const portfinder_sync_1 = tslib_1.__importDefault(require("portfinder-sync"));
8
- const getPort = (packageJson) => portfinder_sync_1.default.getPort(packageJson.config?.PORT || process.env.PORT || 9000);
8
+ const getPort = (packageJson) => { var _a; return portfinder_sync_1.default.getPort(((_a = packageJson.config) === null || _a === void 0 ? void 0 : _a.PORT) || process.env.PORT || 9000); };
9
9
  const getServer = (isHTTPS = false) => {
10
10
  if (isHTTPS) {
11
11
  const certDir = (0, node_path_1.resolve)(__dirname, '../../cert/');
@@ -8,7 +8,7 @@ const entry = (ctx) => {
8
8
  const main = (0, federation_1.federatedIndexExists)()
9
9
  ? (0, federation_1.resolveFederatedIndex)()
10
10
  : (0, node_path_1.resolve)(cwd, './src/' + 'index.ts');
11
- if (serviceWorker?.registration) {
11
+ if (serviceWorker === null || serviceWorker === void 0 ? void 0 : serviceWorker.registration) {
12
12
  return {
13
13
  main,
14
14
  swRegistration: (0, node_path_1.resolve)(cwd, './src/' + serviceWorker.registration),
@@ -36,14 +36,8 @@ const getRemoteEntry = (name, port, host = 'localhost') => `${name}@${(0, export
36
36
  exports.getRemoteEntry = getRemoteEntry;
37
37
  const resolveFederationOptions = (options = {}, pkg) => {
38
38
  const { name, exposes: mfExposes = {}, remotes: mfRemotes = {}, shared: mfShared = {} } = options;
39
- const exposes = {
40
- './index': federatedIndex,
41
- ...mfExposes,
42
- };
43
- const shared = {
44
- ...pkg.dependencies,
45
- ...mfShared,
46
- };
39
+ const exposes = Object.assign({ './index': federatedIndex }, mfExposes);
40
+ const shared = Object.assign(Object.assign({}, pkg.dependencies), mfShared);
47
41
  return {
48
42
  name: name || (0, exports.getFederatedPkgName)(pkg.name),
49
43
  filename: remoteEntryFilename,
@@ -39,8 +39,8 @@ const getConfig = (ctx) => {
39
39
  maxEntrypointSize: 512000,
40
40
  maxAssetSize: 512000,
41
41
  },
42
- target: webpack?.target,
43
- node: webpack?.node,
42
+ target: webpack === null || webpack === void 0 ? void 0 : webpack.target,
43
+ node: webpack === null || webpack === void 0 ? void 0 : webpack.node,
44
44
  };
45
45
  };
46
46
  exports.getConfig = getConfig;
@@ -16,7 +16,7 @@ const vendorCacheGroup = {
16
16
  const optimization = (ctx) => {
17
17
  const { config: { webpack }, cli: { isDev }, } = ctx;
18
18
  // user-supplied custom config
19
- if (typeof webpack?.optimization === 'function') {
19
+ if (typeof (webpack === null || webpack === void 0 ? void 0 : webpack.optimization) === 'function') {
20
20
  return webpack.optimization({ isDev });
21
21
  }
22
22
  // defaults
@@ -32,9 +32,7 @@ const optimization = (ctx) => {
32
32
  splitChunks: {
33
33
  chunks: 'all',
34
34
  maxInitialRequests: 100,
35
- cacheGroups: {
36
- ...vendorCacheGroup,
37
- },
35
+ cacheGroups: Object.assign({}, vendorCacheGroup),
38
36
  },
39
37
  };
40
38
  };
@@ -20,7 +20,7 @@ const filenameGetters = (config = {}) => ({
20
20
  });
21
21
  const output = (ctx) => {
22
22
  const { cli: { isDev }, dirs: { cwd }, config: { webpack }, } = ctx;
23
- const getters = filenameGetters(webpack?.filenames);
23
+ const getters = filenameGetters(webpack === null || webpack === void 0 ? void 0 : webpack.filenames);
24
24
  return {
25
25
  strictModuleErrorHandling: true,
26
26
  strictModuleExceptionHandling: true,
@@ -56,15 +56,11 @@ const plugins = (ctx) => {
56
56
  openAnalyzer: false,
57
57
  }),
58
58
  pwa &&
59
- new webpack_pwa_manifest_1.default({
60
- ...(0, build_kit_1.objToSnakeCase)(pwa),
61
- name: pwa.name,
62
- icons: Array.isArray(pwa.icons) &&
59
+ new webpack_pwa_manifest_1.default(Object.assign(Object.assign({}, (0, build_kit_1.objToSnakeCase)(pwa)), { name: pwa.name, icons: Array.isArray(pwa.icons) &&
63
60
  pwa.icons.map((icon) => ({
64
61
  sizes: icon.sizes,
65
62
  src: (0, node_path_1.resolve)(cwd, icon.src),
66
- })),
67
- }),
63
+ })) })),
68
64
  serviceWorker &&
69
65
  new workbox_webpack_plugin_1.InjectManifest({
70
66
  swSrc: './src/' + serviceWorker.worker,
package/dist/index.js CHANGED
@@ -5,10 +5,10 @@ const build_kit_1 = require("@genesislcap/build-kit");
5
5
  const webpack_1 = tslib_1.__importDefault(require("webpack"));
6
6
  const commands_1 = require("./commands");
7
7
  const config_1 = require("./config");
8
- exports.default = async (ctx) => {
8
+ exports.default = (ctx) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
9
9
  const { dirs: { cwd }, cli: { isDev, isAnalyze, isBuild, options }, enable: { mft }, } = ctx;
10
10
  if (mft) {
11
- const mftCLI = await (0, build_kit_1.resolveBin)('make-federated-types', '@pixability-ui/federated-types');
11
+ const mftCLI = yield (0, build_kit_1.resolveBin)('make-federated-types', '@pixability-ui/federated-types');
12
12
  (0, build_kit_1.run)(cwd, `${mftCLI}`);
13
13
  }
14
14
  if (isDev) {
@@ -19,9 +19,9 @@ exports.default = async (ctx) => {
19
19
  else if (isBuild || isAnalyze) {
20
20
  const config = (0, config_1.getConfig)(ctx);
21
21
  const compiler = (0, webpack_1.default)(config);
22
- await (0, commands_1.build)(compiler);
22
+ yield (0, commands_1.build)(compiler);
23
23
  }
24
24
  else {
25
25
  throw new Error(`Unrecognized command: ${JSON.stringify(options)}`);
26
26
  }
27
- };
27
+ });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/webpack-builder",
3
3
  "description": "Webpack builder",
4
- "version": "14.70.4-es2021.1",
4
+ "version": "14.70.4-test.1",
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.70.4-es2021.1",
15
+ "@genesislcap/build-kit": "14.70.4-test.1",
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",
@@ -54,5 +54,5 @@
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
- "gitHead": "5d0d8ee36cfd068cfc6211033b326d0a978cfc05"
57
+ "gitHead": "2414c66a7a84c61343d756e240cb4140d82f1311"
58
58
  }