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

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,7 +72,8 @@ class CdnChangePlugin {
72
72
  const {
73
73
  createSeparateSMap,
74
74
  mode
75
- } = this; // eslint-disable-next-line no-param-reassign
75
+ } = this;
76
+ console.log(data.assets, 'jd'); // eslint-disable-next-line no-param-reassign
76
77
 
77
78
  data.assets = { ...data.assets,
78
79
  css: data.assets.css.map(css => `${this.cssTemplate}${css}`),
@@ -19,6 +19,8 @@ class MurphyInjectorPlugin {
19
19
  constructor(entries = [], options) {
20
20
  this.entries = entries;
21
21
  this.options = options;
22
+ this.jsTemplate = options.cdnMapping.jsTemplate || '{{__JS_CDN__}}';
23
+ this.cdnMapping = options.cdnMapping;
22
24
  }
23
25
 
24
26
  apply(compiler) {
@@ -54,6 +56,8 @@ class MurphyInjectorPlugin {
54
56
  const childChunks = childCompilation.chunks;
55
57
 
56
58
  _htmlWebpackPlugin.default.getHooks(compilation).alterAssetTags.tapAsync(pluginName, (data, cb) => {
59
+ data.assets = { ...data.assets
60
+ };
57
61
  let fileName = "";
58
62
  childChunks.forEach(chunk => {
59
63
  fileName = compilation.getPath((0, _nameTemplates.nameTemplates)("js", this.options), {
@@ -61,6 +65,12 @@ class MurphyInjectorPlugin {
61
65
  contentHashType: "javascript"
62
66
  }); // ✅ Use Webpack's getPath to resolve your template properly
63
67
  });
68
+
69
+ if (this.cdnMapping.isCdnEnabled) {
70
+ fileName = `${this.jsTemplate}${fileName}`;
71
+ }
72
+
73
+ ;
64
74
  data.assetTags.scripts.unshift({
65
75
  tagName: "script",
66
76
  voidTag: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.12-exp.5",
3
+ "version": "0.0.12-exp.6",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {