@zohodesk/client_build_tool 0.0.5-exp.2 → 0.0.5-exp.4
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 +9 -0
- package/README.md +9 -0
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +4 -8
- package/lib/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +3 -3
- package/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +16 -3
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog and Release Notes
|
|
2
2
|
|
|
3
|
+
## v0.0.5-exp.4 (14-09-2023)
|
|
4
|
+
|
|
5
|
+
**changes:--**
|
|
6
|
+
- changing jsPP,cssPP,i18nPP values in ResourceHintsPlugin
|
|
7
|
+
|
|
8
|
+
## v0.0.5-exp.3 (11-09-2023)
|
|
9
|
+
|
|
10
|
+
**changes:--**
|
|
11
|
+
- changing plugin hook stages in i18nRuntimePlugin and sourceMapPlugin
|
|
3
12
|
## v0.0.5 (6-08-2023)
|
|
4
13
|
|
|
5
14
|
**Changes:--**
|
package/README.md
CHANGED
|
@@ -84,6 +84,15 @@ These commands provide flexibility and control over your client-side build proce
|
|
|
84
84
|
For more [Details](ConfigurationDocumentation.md)
|
|
85
85
|
# Changelog and Release Notes
|
|
86
86
|
|
|
87
|
+
## v0.0.5-exp.4 (14-09-2023)
|
|
88
|
+
|
|
89
|
+
**changes:--**
|
|
90
|
+
- changing jsPP,cssPP,i18nPP values in ResourceHintsPlugin
|
|
91
|
+
|
|
92
|
+
## v0.0.5-exp.3 (11-09-2023)
|
|
93
|
+
|
|
94
|
+
**changes:--**
|
|
95
|
+
- changing plugin hook stages in i18nRuntimePlugin and sourceMapPlugin
|
|
87
96
|
## v0.0.5 (6-08-2023)
|
|
88
97
|
|
|
89
98
|
**Changes:--**
|
package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js
CHANGED
|
@@ -145,7 +145,7 @@ class I18nRuntimeDealerPlugin {
|
|
|
145
145
|
if (chunkFilenameHasContentHash) {
|
|
146
146
|
compilation.hooks.processAssets.tap({
|
|
147
147
|
name: pluginName,
|
|
148
|
-
stage: _webpack.Compilation.
|
|
148
|
+
stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_DERIVED // additionalAssets: true
|
|
149
149
|
|
|
150
150
|
}, assets => {
|
|
151
151
|
// eslint-disable-next-line no-underscore-dangle
|
|
@@ -174,32 +174,28 @@ class I18nRuntimeDealerPlugin {
|
|
|
174
174
|
runtimeFileName,
|
|
175
175
|
runtimeFileSourceStr,
|
|
176
176
|
i18nChunks
|
|
177
|
-
})); // NOTE: we don't delete, Because of HTML plugin needs to add runtime file in html and efc
|
|
177
|
+
})); // NOTE: we don't delete, Because of HTML plugin needs to add runtime file in html and efc
|
|
178
178
|
// compilation.deleteAsset(runtimeFileName);
|
|
179
179
|
}
|
|
180
180
|
});
|
|
181
181
|
compilation.hooks.processAssets.tap({
|
|
182
182
|
name: pluginName,
|
|
183
|
-
stage: _webpack.Compilation.
|
|
183
|
+
stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE // additionalAssets: true
|
|
184
184
|
|
|
185
185
|
}, () => {
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
188
187
|
const entries = compilation._getChunkGraphEntries(); // eslint-disable-next-line no-restricted-syntax
|
|
189
188
|
|
|
190
189
|
|
|
191
190
|
for (const entryChunk of entries) {
|
|
192
191
|
const runtimeFileName = [...entryChunk.files][0] || '';
|
|
193
|
-
console.log(runtimeFileName, 'runtimeFile==');
|
|
194
192
|
|
|
195
193
|
if (runtimeFileName.includes('runtime') && runtimeFileName.includes('[locale]')) {
|
|
196
194
|
(0, _logger.verboseLogger)('deleteAsset', runtimeFileName);
|
|
197
|
-
console.log('deleted successuly====');
|
|
198
195
|
compilation.deleteAsset(runtimeFileName);
|
|
199
196
|
}
|
|
200
197
|
}
|
|
201
198
|
});
|
|
202
|
-
console.log('completed ====');
|
|
203
199
|
}
|
|
204
200
|
}
|
|
205
201
|
|
|
@@ -96,9 +96,9 @@ class ResourceHintsRuntimePlugin extends _webpack.RuntimeModule {
|
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
const {
|
|
99
|
-
js: jsPP =
|
|
100
|
-
css: cssPP =
|
|
101
|
-
i18n: i18nPP =
|
|
99
|
+
js: jsPP = _webpack.RuntimeGlobals.publicPath,
|
|
100
|
+
css: cssPP = _webpack.RuntimeGlobals.publicPath,
|
|
101
|
+
i18n: i18nPP = _webpack.RuntimeGlobals.publicPath
|
|
102
102
|
} = this.publicPathsTemplateObj;
|
|
103
103
|
return _webpack.Template.asString([`
|
|
104
104
|
const preloadedChunks = {};
|
|
@@ -8,7 +8,20 @@ exports.SourceMapPlugin = void 0;
|
|
|
8
8
|
var _webpack = require("webpack");
|
|
9
9
|
|
|
10
10
|
/* eslint-disable class-methods-use-this */
|
|
11
|
-
|
|
11
|
+
function checkSmapFilePattern(assetName) {
|
|
12
|
+
return /\.js$/.test(assetName) && !/\.i18n\.js$/.test(assetName) || /\.js\.map$/.test(assetName) && !/\.i18n\.js\.map$/.test(assetName);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function skipRuntimeFiles(assetName) {
|
|
16
|
+
return !assetName.includes('runtime') || !assetName.includes('[locale]');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const pluginName = 'SplitSourceMapPlugin'; // Purpose:
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* we want build that can load files source map and without sourcemap at the same time,
|
|
23
|
+
* or can be mentioned as so single build need to support two different clients that one for fast load and one for debugging.
|
|
24
|
+
*/
|
|
12
25
|
|
|
13
26
|
class SourceMapPlugin {
|
|
14
27
|
apply(compiler) {
|
|
@@ -18,12 +31,12 @@ class SourceMapPlugin {
|
|
|
18
31
|
compiler.hooks.thisCompilation.tap(pluginName, compilation => {
|
|
19
32
|
compilation.hooks.processAssets.tap({
|
|
20
33
|
name: pluginName,
|
|
21
|
-
stage: _webpack.Compilation.
|
|
34
|
+
stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
|
|
22
35
|
}, assets => {
|
|
23
36
|
Object.keys(assets).forEach(assetName => {
|
|
24
37
|
const assetCode = assets[assetName].source();
|
|
25
38
|
|
|
26
|
-
if (
|
|
39
|
+
if (checkSmapFilePattern(assetName) && skipRuntimeFiles(assetName)) {
|
|
27
40
|
compilation.renameAsset(assetName, `smap/${assetName}`);
|
|
28
41
|
|
|
29
42
|
if (!/\.map$/.test(assetName)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/client_build_tool",
|
|
3
|
-
"version": "0.0.5-exp.
|
|
3
|
+
"version": "0.0.5-exp.4",
|
|
4
4
|
"description": "A CLI tool to build web applications and client libraries",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"cbt": "cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
+
"exp:publish": "npm publish --tag exp",
|
|
11
12
|
"start": "rm -r lib && npm run build -- -w",
|
|
12
13
|
"prepare": "npm run build",
|
|
13
14
|
"build": "babel src --out-dir lib --copy-files --config-file=./.babelrc",
|