@zohodesk/react-cli 1.1.20-exp.2 → 1.1.20-exp.3

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.
@@ -26,25 +26,29 @@ let getEntries = (appSchemas, mode) => {
26
26
  hasEFC: newOptionForEnableEFC
27
27
  } = appSchemas.efc;
28
28
  const hasEFC = newOptionForEnableEFC || prevOptionForEnableEFC;
29
- let mainJs = [];
30
- let payloadJs = [];
31
- let entry = {
32
- main: mainJs,
33
- payload: payloadJs
34
- };
35
-
36
- if (mode === 'dev' || mode === 'dev-no-warn') {// mainJs.push(
37
- // `${path.join(
38
- // __dirname,
39
- // '..',
40
- // 'templates',
41
- // 'WMSTemplate'
42
- // )}?wmsPath=wss:${getServerURL(server)}`
43
- // );
29
+ const {
30
+ multiEntry
31
+ } = appSchemas.app;
32
+ let mainJs = []; // let payloadJs = [];
33
+
34
+ let entryObj = {};
35
+ console.log(multiEntry);
36
+
37
+ if (multiEntry.enable) {
38
+ entryObj = (0, _utils.createObjectFromArrayPairs)(multiEntry.chunkName, multiEntry.entryFileName, appPath, folder);
39
+ }
40
+
41
+ let entry = Object.assign({
42
+ main: mainJs
43
+ }, entryObj);
44
+
45
+ if (mode === 'dev' || mode === 'dev-no-warn') {
46
+ mainJs.push(`${_path.default.join(__dirname, '..', 'templates', 'WMSTemplate')}?wmsPath=wss:${(0, _utils.getServerURL)(server)}`);
44
47
  }
45
48
 
46
- mainJs.push(_path.default.join(appPath, folder, isReactMig ? 'migration.js' : 'index.js'));
47
- payloadJs.push(_path.default.join(appPath, folder, '_utils', 'payloadEncryption.js'));
49
+ mainJs.push(_path.default.join(appPath, folder, isReactMig ? 'migration.js' : 'index.js')); // payloadJs.push(
50
+ // path.join(appPath, folder, '_utils', 'payloadEncryption.js')
51
+ // );
48
52
 
49
53
  if (hasWidget) {
50
54
  entry.widget = [_path.default.join(appPath, folder, 'widget.js')];
@@ -125,6 +125,11 @@ var _default = {
125
125
  cssDirStatement: null
126
126
  },
127
127
  app: {
128
+ multiEntry: {
129
+ enable: true,
130
+ chunkName: [],
131
+ entryFileName: []
132
+ },
128
133
  moduleResolvePath: {
129
134
  value: '@zohodesk/client_packages_group',
130
135
  cli: 'module_resolve_path'
@@ -7,6 +7,7 @@ var _exportNames = {
7
7
  writeFile: true,
8
8
  makeDir: true,
9
9
  getInfoFromPublicPaths: true,
10
+ createObjectFromArrayPairs: true,
10
11
  getLibraryConflict: true,
11
12
  log: true,
12
13
  getOptions: true,
@@ -27,6 +28,7 @@ Object.defineProperty(exports, "createEventStream", {
27
28
  return _createEventStream.default;
28
29
  }
29
30
  });
31
+ exports.createObjectFromArrayPairs = void 0;
30
32
  Object.defineProperty(exports, "getComponents", {
31
33
  enumerable: true,
32
34
  get: function () {
@@ -103,6 +105,8 @@ var _fs = _interopRequireDefault(require("fs"));
103
105
 
104
106
  var _log = require("./log");
105
107
 
108
+ var _path = _interopRequireDefault(require("path"));
109
+
106
110
  var _getOptions = _interopRequireDefault(require("./getOptions"));
107
111
 
108
112
  var _createEventStream = _interopRequireDefault(require("./createEventStream"));
@@ -239,6 +243,22 @@ let getInfoFromPublicPaths = publicPaths => {
239
243
 
240
244
  exports.getInfoFromPublicPaths = getInfoFromPublicPaths;
241
245
 
246
+ let createObjectFromArrayPairs = (arr1, arr2, appPath, folder) => {
247
+ if (arr1.length !== arr2.length) {
248
+ throw new Error('multiple chunk entry wrongly configured check the getEntries.js and react-cli.config.js file ');
249
+ }
250
+
251
+ const obj = {};
252
+
253
+ for (let i = 0; i < arr1.length; i++) {
254
+ obj[arr1[i]] = [_path.default.join(appPath, folder, arr2[i])];
255
+ }
256
+
257
+ return obj;
258
+ };
259
+
260
+ exports.createObjectFromArrayPairs = createObjectFromArrayPairs;
261
+
242
262
  let getLibraryConflict = (moduleObject, impactObj, changesOnly) => {
243
263
  let srcChanges = [];
244
264
  let libraryChanges = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/react-cli",
3
- "version": "1.1.20-exp.2",
3
+ "version": "1.1.20-exp.3",
4
4
  "description": "A CLI tool for build modern web application and libraries",
5
5
  "scripts": {
6
6
  "init": "node ./lib/utils/init.js",