@zohodesk/client_build_tool 0.0.12-exp.9 → 0.0.13

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog and Release Notes
2
2
 
3
+ # v0.0.13 (02-09-2025)
4
+
5
+ **Adjustments:-**
6
+ - Source map files are created in the smap/ folder by default. However, they are also being created in the js/ folder to resolve the issue where Murphy was unable to locate them.
7
+
8
+ **Feature:-**
9
+ - Added support for Murphy to be built as a separate chunk and injected as the top script in the initial HTML.
10
+ - To enable this support , add this in your configuration
11
+
12
+ ```murphyBootstrapHtml{
13
+ enable: true,
14
+ chunkName: '',
15
+ filePath: ''
16
+ }```
17
+
18
+
19
+
3
20
  # v0.0.12 (14-08-2025)
4
21
 
5
22
  - Fixed the initial i18n loading issue caused by using the same function in both the i18nRuntimeDealer plugin and decidePublicPath
package/README.md CHANGED
@@ -306,6 +306,23 @@ First Release
306
306
  - 'templates' command to create es for react library
307
307
  # Changelog and Release Notes
308
308
 
309
+ # v0.0.13 (02-09-2025)
310
+
311
+ **Adjustments:-**
312
+ - Source map files are created in the smap/ folder by default. However, they are also being created in the js/ folder to resolve the issue where Murphy was unable to locate them.
313
+
314
+ **Feature:-**
315
+ - Added support for Murphy to be built as a separate chunk and injected as the top script in the initial HTML.
316
+ - To enable this support , add this in your configuration
317
+
318
+ ```murphyBootstrapHtml{
319
+ enable: true,
320
+ chunkName: '',
321
+ filePath: ''
322
+ }```
323
+
324
+
325
+
309
326
  # v0.0.12 (14-08-2025)
310
327
 
311
328
  - Fixed the initial i18n loading issue caused by using the same function in both the i18nRuntimeDealer plugin and decidePublicPath
@@ -350,6 +350,11 @@ var _default = {
350
350
  customScriptLoadingStrategey: {
351
351
  enable: false,
352
352
  options: null
353
+ },
354
+ murphyBootstrapHtml: {
355
+ enable: false,
356
+ chunkName: '',
357
+ filePath: ''
353
358
  }
354
359
  };
355
360
  exports.default = _default;
@@ -53,8 +53,6 @@ class MurphyInjectorPlugin {
53
53
  // ⚡ Hook HtmlWebpackPlugin and inject this file
54
54
 
55
55
 
56
- const childChunks = childCompilation.chunks;
57
-
58
56
  _htmlWebpackPlugin.default.getHooks(compilation).alterAssetTags.tapAsync(pluginName, (data, cb) => {
59
57
  let fileName = '';
60
58
  const childFiles = childCompilation.entrypoints.get(name).getFiles();
@@ -14,8 +14,18 @@ var _path = _interopRequireDefault(require("path"));
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
16
16
  function configMurphyInjectorPlugin(options) {
17
- return new _MurphyInjectorPlugin.default([{
18
- name: "murphy",
19
- file: _path.default.join(_constants.appPath, "./src/library/murphy/initial_html/index.js")
20
- }], options);
17
+ const {
18
+ enable,
19
+ chunkName,
20
+ filePath
21
+ } = options.murphyBootstrapHtml;
22
+
23
+ if (enable) {
24
+ return new _MurphyInjectorPlugin.default([{
25
+ name: chunkName,
26
+ file: _path.default.join(_constants.appPath, filePath)
27
+ }], options);
28
+ }
29
+
30
+ return null;
21
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.12-exp.9",
3
+ "version": "0.0.13",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -1,82 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _SingleEntryPlugin = _interopRequireDefault(require("webpack/lib/SingleEntryPlugin.js"));
9
-
10
- var _nameTemplates = require("../../common/nameTemplates");
11
-
12
- var _htmlWebpackPlugin = _interopRequireDefault(require("html-webpack-plugin"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- class DummyPlugin {
17
- constructor(entries = [], options) {
18
- this.entries = entries;
19
- this.options = options;
20
- }
21
-
22
- apply(compiler) {
23
- compiler.hooks.thisCompilation.tap("AdditionalEntriesPlugin", compilation => {
24
- this.entries.forEach(({
25
- name,
26
- file
27
- }) => {
28
- // Create child compiler for this entry
29
- const childCompiler = compilation.createChildCompiler(`additional-entry ${name}`, {
30
- filename: (0, _nameTemplates.nameTemplates)('js', this.options),
31
- // output filename
32
- chunkFilename: `${name}.[id].js`,
33
- publicPath: compiler.options.output.publicPath,
34
- globalObject: "self" // safe for workers too
35
-
36
- }); // Attach the entry point
37
-
38
- new _SingleEntryPlugin.default(compiler.context, file, name).apply(childCompiler); // Run the child compiler
39
-
40
- childCompiler.runAsChild((err, entries, childCompilation) => {
41
- if (err) {
42
- compilation.errors.push(err);
43
- return;
44
- }
45
-
46
- if (childCompilation.errors && childCompilation.errors.length) {
47
- compilation.errors.push(...childCompilation.errors);
48
- } // Files are emitted automatically by child compiler
49
- // ⚡ Hook HtmlWebpackPlugin and inject this file
50
-
51
-
52
- const childChunks = childCompilation.chunks;
53
-
54
- _htmlWebpackPlugin.default.getHooks(compilation).alterAssetTags.tapAsync("DummyPlugin", (data, cb) => {
55
- let fileName = "";
56
- childChunks.forEach(chunk => {
57
- fileName = compilation.getPath((0, _nameTemplates.nameTemplates)("js", this.options), {
58
- chunk,
59
- contentHashType: "javascript"
60
- }); // ✅ Use Webpack's getPath to resolve your template properly
61
- });
62
- data.assetTags.scripts.unshift({
63
- tagName: "script",
64
- voidTag: false,
65
- attributes: {
66
- src: fileName
67
- },
68
- meta: {
69
- plugin: "DummyPlugin"
70
- }
71
- });
72
- cb(null, data);
73
- });
74
- });
75
- });
76
- });
77
- }
78
-
79
- }
80
-
81
- var _default = DummyPlugin;
82
- exports.default = _default;
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ConfigMurphyInjectorPlugin = ConfigMurphyInjectorPlugin;
7
-
8
- var _constants = require("../../../constants");
9
-
10
- var _DummyPlugin = _interopRequireDefault(require("../custom_plugins/DummyPlugin"));
11
-
12
- var _path = _interopRequireDefault(require("path"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function ConfigMurphyInjectorPlugin(options) {
17
- return new MurphyInjectorPlugin([{
18
- name: "murphy",
19
- file: _path.default.join(_constants.appPath, "./src/library/murphy/initial_html/index.js")
20
- }], options);
21
- }