@zohodesk/client_build_tool 0.0.12-exp.6 → 0.0.12-exp.7

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.
@@ -72,8 +72,7 @@ class CdnChangePlugin {
72
72
  const {
73
73
  createSeparateSMap,
74
74
  mode
75
- } = this;
76
- console.log(data.assets, 'jd'); // eslint-disable-next-line no-param-reassign
75
+ } = this; // eslint-disable-next-line no-param-reassign
77
76
 
78
77
  data.assets = { ...data.assets,
79
78
  css: data.assets.css.map(css => `${this.cssTemplate}${css}`),
@@ -56,18 +56,15 @@ class MurphyInjectorPlugin {
56
56
  const childChunks = childCompilation.chunks;
57
57
 
58
58
  _htmlWebpackPlugin.default.getHooks(compilation).alterAssetTags.tapAsync(pluginName, (data, cb) => {
59
- data.assets = { ...data.assets
60
- };
61
- let fileName = "";
62
- childChunks.forEach(chunk => {
63
- fileName = compilation.getPath((0, _nameTemplates.nameTemplates)("js", this.options), {
64
- chunk,
65
- contentHashType: "javascript"
66
- }); // ✅ Use Webpack's getPath to resolve your template properly
67
- });
59
+ let fileName = '';
60
+ const childFiles = childCompilation.entrypoints.get(name).getFiles();
61
+
62
+ if (childFiles.length !== 1) {
63
+ compilation.errors.push(new Error(`${pluginName}: Expected exactly 1 child file for entry "${name}", but got ${childFiles.length}.`));
64
+ }
68
65
 
69
66
  if (this.cdnMapping.isCdnEnabled) {
70
- fileName = `${this.jsTemplate}${fileName}`;
67
+ fileName = childFiles[0];
71
68
  }
72
69
 
73
70
  ;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.12-exp.6",
3
+ "version": "0.0.12-exp.7",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {