@zohodesk/client_build_tool 0.0.2 → 0.0.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.
- package/CHANGELOG.md +11 -0
- package/README.md +11 -0
- package/lib/schemas/defaultConfigValues.js +1 -1
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +22 -2
- package/lib/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +4 -2
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +4 -2
- package/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +4 -2
- package/lib/shared/bundler/webpack/outputConfig.js +3 -1
- package/lib/shared/bundler/webpack/webpackConfig.js +2 -2
- package/package.json +1 -1
- package/lib/commands/build/errorHander.js +0 -10
- package/lib/commands/start/deprecationHandler.js +0 -10
- package/lib/commands/start/errorHander.js +0 -10
- package/lib/commands/start/postProcessor.js +0 -10
- package/lib/commands/version/errorHander.js +0 -10
- package/lib/shared/bundler/webpack/pluginConfigs/dummy.js +0 -23
- /package/lib/shared/bundler/webpack/{getSourceMapType.js → devtoolConfig.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog and Release Notes
|
|
2
2
|
|
|
3
|
+
## v0.0.2 (28-04-2023)
|
|
4
|
+
|
|
5
|
+
**Changes:--**
|
|
6
|
+
- `devtool` default value changed from `hidden-cheap-source-map` to `source-map`
|
|
7
|
+
- unwanted files deleted from build
|
|
8
|
+
|
|
9
|
+
**Issue Fix:--**
|
|
10
|
+
- The issue with the source map not being created in the build has been fixed."
|
|
11
|
+
|
|
12
|
+
|
|
3
13
|
## v0.0.2 (28-04-2023)
|
|
4
14
|
|
|
5
15
|
**Features:-**
|
|
@@ -18,6 +28,7 @@
|
|
|
18
28
|
- `manifestJson` default value set as false.
|
|
19
29
|
- `customAttributes` support for add attributes to html, link , script tag in the output build.
|
|
20
30
|
|
|
31
|
+
|
|
21
32
|
## v0.0.1 (18-04-2023)
|
|
22
33
|
|
|
23
34
|
First Release
|
package/README.md
CHANGED
|
@@ -84,6 +84,16 @@ 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.2 (28-04-2023)
|
|
88
|
+
|
|
89
|
+
**Changes:--**
|
|
90
|
+
- `devtool` default value changed from `hidden-cheap-source-map` to `source-map`
|
|
91
|
+
- unwanted files deleted from build
|
|
92
|
+
|
|
93
|
+
**Issue Fix:--**
|
|
94
|
+
- The issue with the source map not being created in the build has been fixed."
|
|
95
|
+
|
|
96
|
+
|
|
87
97
|
## v0.0.2 (28-04-2023)
|
|
88
98
|
|
|
89
99
|
**Features:-**
|
|
@@ -102,6 +112,7 @@ For more [Details](ConfigurationDocumentation.md)
|
|
|
102
112
|
- `manifestJson` default value set as false.
|
|
103
113
|
- `customAttributes` support for add attributes to html, link , script tag in the output build.
|
|
104
114
|
|
|
115
|
+
|
|
105
116
|
## v0.0.1 (18-04-2023)
|
|
106
117
|
|
|
107
118
|
First Release
|
package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js
CHANGED
|
@@ -23,6 +23,8 @@ var _I18nFilesEmitPlugin = require("./I18nFilesEmitPlugin");
|
|
|
23
23
|
|
|
24
24
|
var _LocaleChunkAssetsStore = require("./LocaleChunkAssetsStore");
|
|
25
25
|
|
|
26
|
+
var _logger = require("../../../../../logger");
|
|
27
|
+
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
27
29
|
|
|
28
30
|
const {
|
|
@@ -63,7 +65,7 @@ class I18nRuntimeDealerPlugin {
|
|
|
63
65
|
mainChunkName
|
|
64
66
|
} = this.options; // const dummyContent = '// dummy comment';
|
|
65
67
|
|
|
66
|
-
const dummyContentHash = '
|
|
68
|
+
const dummyContentHash = 'dummy0content0hashes';
|
|
67
69
|
const entryPoint = compilation.entrypoints.get(mainChunkName);
|
|
68
70
|
const initialChunks = Array.from(entryPoint.chunks).filter(c => c.canBeInitial() && c.id !== c.runtime);
|
|
69
71
|
const initialI18nAssets = initialChunks.filter(c => i18nStore.isChunkHasI18n(c)).map(c => {
|
|
@@ -172,10 +174,28 @@ class I18nRuntimeDealerPlugin {
|
|
|
172
174
|
runtimeFileName,
|
|
173
175
|
runtimeFileSourceStr,
|
|
174
176
|
i18nChunks
|
|
175
|
-
})); // NOTE: we don't delete, Because of HTML plugin needs to add runtime file in html
|
|
177
|
+
})); // NOTE: we don't delete, Because of HTML plugin needs to add runtime file in html and efc
|
|
176
178
|
// compilation.deleteAsset(runtimeFileName);
|
|
177
179
|
}
|
|
178
180
|
});
|
|
181
|
+
compilation.hooks.processAssets.tap({
|
|
182
|
+
name: pluginName,
|
|
183
|
+
stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE // additionalAssets: true
|
|
184
|
+
|
|
185
|
+
}, () => {
|
|
186
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
187
|
+
const entries = compilation._getChunkGraphEntries(); // eslint-disable-next-line no-restricted-syntax
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
for (const entryChunk of entries) {
|
|
191
|
+
const runtimeFileName = [...entryChunk.files][0] || '';
|
|
192
|
+
|
|
193
|
+
if (runtimeFileName.includes('runtime') && runtimeFileName.includes('[local]')) {
|
|
194
|
+
(0, _logger.verboseLogger)('deleteAsset', runtimeFileName);
|
|
195
|
+
compilation.deleteAsset(runtimeFileName);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
});
|
|
179
199
|
}
|
|
180
200
|
}
|
|
181
201
|
|
|
@@ -9,6 +9,8 @@ var _htmlWebpackPlugin = _interopRequireDefault(require("html-webpack-plugin"));
|
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
+
const pluginName = 'InitialHtmlPlugin';
|
|
13
|
+
|
|
12
14
|
class InitialHtmlPlugin {
|
|
13
15
|
constructor(options) {
|
|
14
16
|
this.options = options;
|
|
@@ -30,8 +32,8 @@ class InitialHtmlPlugin {
|
|
|
30
32
|
inject,
|
|
31
33
|
scriptLoading: 'defer'
|
|
32
34
|
}).apply(compiler);
|
|
33
|
-
compiler.hooks.thisCompilation.tap(
|
|
34
|
-
_htmlWebpackPlugin.default.getHooks(compilation).alterAssetTagGroups.tapAsync(
|
|
35
|
+
compiler.hooks.thisCompilation.tap(pluginName, compilation => {
|
|
36
|
+
_htmlWebpackPlugin.default.getHooks(compilation).alterAssetTagGroups.tapAsync(pluginName, (data, cb) => {
|
|
35
37
|
const headTags = [];
|
|
36
38
|
const bodyTags = [];
|
|
37
39
|
data.headTags.forEach(tag => {
|
|
@@ -9,6 +9,8 @@ var _webpack = require("webpack");
|
|
|
9
9
|
|
|
10
10
|
var _createManifestJson = require("./createManifestJson");
|
|
11
11
|
|
|
12
|
+
const pluginName = 'AddFileToManifestJson';
|
|
13
|
+
|
|
12
14
|
class AddFileToManifestJson {
|
|
13
15
|
constructor(options) {
|
|
14
16
|
this.options = options;
|
|
@@ -18,9 +20,9 @@ class AddFileToManifestJson {
|
|
|
18
20
|
const {
|
|
19
21
|
RawSource
|
|
20
22
|
} = compiler.webpack.sources;
|
|
21
|
-
compiler.hooks.thisCompilation.tap(
|
|
23
|
+
compiler.hooks.thisCompilation.tap(pluginName, compilation => {
|
|
22
24
|
compilation.hooks.processAssets.tap({
|
|
23
|
-
name:
|
|
25
|
+
name: pluginName,
|
|
24
26
|
stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_SUMMARIZE
|
|
25
27
|
}, assets => {
|
|
26
28
|
const {
|
|
@@ -8,14 +8,16 @@ exports.SourceMapPlugin = void 0;
|
|
|
8
8
|
var _webpack = require("webpack");
|
|
9
9
|
|
|
10
10
|
/* eslint-disable class-methods-use-this */
|
|
11
|
+
const pluginName = 'SplitSourceMapPlugin';
|
|
12
|
+
|
|
11
13
|
class SourceMapPlugin {
|
|
12
14
|
apply(compiler) {
|
|
13
15
|
const {
|
|
14
16
|
RawSource
|
|
15
17
|
} = compiler.webpack.sources;
|
|
16
|
-
compiler.hooks.thisCompilation.tap(
|
|
18
|
+
compiler.hooks.thisCompilation.tap(pluginName, compilation => {
|
|
17
19
|
compilation.hooks.processAssets.tap({
|
|
18
|
-
name:
|
|
20
|
+
name: pluginName,
|
|
19
21
|
stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
|
|
20
22
|
}, assets => {
|
|
21
23
|
Object.keys(assets).forEach(assetName => {
|
|
@@ -17,11 +17,13 @@ function outputConfig(options) {
|
|
|
17
17
|
const {
|
|
18
18
|
output,
|
|
19
19
|
publicPath,
|
|
20
|
-
htmlTemplate
|
|
20
|
+
htmlTemplate,
|
|
21
|
+
context
|
|
21
22
|
} = options;
|
|
22
23
|
const outputO = {
|
|
23
24
|
filename: (0, _nameTemplates.nameTemplates)('js', options),
|
|
24
25
|
chunkFilename: (0, _nameTemplates.nameTemplates)('chunkjs', options),
|
|
26
|
+
chunkLoadingGlobal: `${context}Jsonp`,
|
|
25
27
|
publicPath,
|
|
26
28
|
// clean: true,
|
|
27
29
|
path: _path.default.resolve(_constants.appPath, output)
|
|
@@ -27,7 +27,7 @@ var _configWebWorkerLoader = require("./loaderConfigs/configWebWorkerLoader");
|
|
|
27
27
|
|
|
28
28
|
var _statsConfig = require("./statsConfig");
|
|
29
29
|
|
|
30
|
-
var
|
|
30
|
+
var _devtoolConfig = require("./devtoolConfig");
|
|
31
31
|
|
|
32
32
|
var _modeUtils = require("./common/modeUtils");
|
|
33
33
|
|
|
@@ -40,7 +40,7 @@ function webpackConfigCreator(options) {
|
|
|
40
40
|
entry: (0, _entryConfig.entryConfig)(options),
|
|
41
41
|
mode: (0, _modeUtils.getWebpackMode)(options),
|
|
42
42
|
output: (0, _outputConfig.outputConfig)(options),
|
|
43
|
-
devtool: (0,
|
|
43
|
+
devtool: (0, _devtoolConfig.devtoolConfig)(options),
|
|
44
44
|
stats: (0, _statsConfig.statsConfig)(options),
|
|
45
45
|
optimization: (0, _optimizationConfig.optimizationConfig)(options),
|
|
46
46
|
module: {
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.deprecationHandler = deprecationHandler;
|
|
7
|
-
|
|
8
|
-
function deprecationHandler(options) {// options.app.deprecated &&
|
|
9
|
-
// console.log('options.app.deprecated this option was deprecated since V1.3.1' );
|
|
10
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.dummy = dummy;
|
|
7
|
-
|
|
8
|
-
class Demo {
|
|
9
|
-
// eslint-disable-next-line class-methods-use-this
|
|
10
|
-
apply(compiler) {
|
|
11
|
-
compiler.hooks.done.tap('vbxhb', stats => {
|
|
12
|
-
const statsJson = stats.toJson({
|
|
13
|
-
all: true
|
|
14
|
-
});
|
|
15
|
-
console.log(statsJson);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function dummy() {
|
|
22
|
-
return new Demo();
|
|
23
|
-
}
|
|
File without changes
|