@zohodesk/client_build_tool 0.0.1 → 0.0.2
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 +25 -4
- package/ConfigurationDocumentation.md +239 -73
- package/README.md +27 -4
- package/README_backup.md +2 -0
- package/TODO.md +1 -1
- package/coverage/addFilesNamesToManifestJson.js.html +148 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/addFilesNamesToManifestJson.js.html +148 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/createInitialEntries.js.html +136 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/createManifestJson.js.html +181 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/findInitialFileNames.js.html +133 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/index.html +146 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/index.js.html +199 -0
- package/coverage/bundler/webpack/custom_plugins/AddManifestJson/removeHashFromFileName.js.html +127 -0
- package/coverage/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js.html +346 -0
- package/coverage/bundler/webpack/custom_plugins/VariableConversionCollector/index.html +116 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/constants.js.html +94 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js.html +259 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/index.html +236 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/index.js.html +442 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/insertBefore.js.html +154 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js.html +142 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js.html +127 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js.html +139 -0
- package/coverage/{updateArrayWithDefault.js.html → bundler/webpack/custom_postcss_plugins/HoverActivePlugin/specialCases.js.html} +55 -67
- package/coverage/bundler/webpack/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js.html +193 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/SelectorReplace.js.html +292 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/ValueReplacer.js.html +223 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/VariableModificationPlugin/index.html +116 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/VariableModificationPlugin/index.js.html +1126 -0
- package/coverage/bundler/webpack/custom_postcss_plugins/index.html +131 -0
- package/coverage/bundler/webpack/loaderConfigs/getSpecificPostCssPlugin.js.html +247 -0
- package/coverage/bundler/webpack/loaderConfigs/index.html +116 -0
- package/coverage/coverage-final.json +3 -1
- package/coverage/coverage-summary.json +4 -2
- package/coverage/createInitialEntries.js.html +136 -0
- package/coverage/dummy.js.html +238 -0
- package/coverage/index.html +51 -21
- package/coverage/index.js.html +169 -0
- package/coverage/isObject.js.html +94 -0
- package/coverage/isValid.js.html +106 -0
- package/coverage/removeHashFromFileName.js.html +127 -0
- package/docs/BabelCustomizations.md +55 -0
- package/lib/commands/build/preProcessor.js +12 -0
- package/lib/commands/buildEs/preProcessor.js +17 -0
- package/lib/commands/buildLib/preProcessor.js +17 -0
- package/lib/commands/pre_process/commandExecutor.js +18 -0
- package/lib/commands/pre_process/config.js +12 -0
- package/lib/commands/start/preProcessor.js +3 -1
- package/lib/schemas/defaultConfigValues.js +65 -29
- package/lib/schemas/defaultConfigValuesOnly.js +20 -1
- package/lib/shared/babel/addDefaultPlugins.js +15 -0
- package/lib/shared/babel/babelWebConfig.js +2 -2
- package/lib/shared/babel/getBabelPlugin.js +37 -0
- package/lib/shared/bundler/webpack/common/nameTemplates.js +31 -8
- package/lib/shared/bundler/webpack/configCustomLoaders.js +1 -1
- package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +1 -1
- package/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +80 -0
- package/lib/shared/bundler/webpack/getCSSLoaders.js +2 -0
- package/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +1 -53
- package/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +7 -0
- package/lib/shared/bundler/webpack/outputConfig.js +9 -2
- package/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +20 -0
- package/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +25 -10
- package/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +2 -2
- package/lib/shared/bundler/webpack/pluginConfigs/dummy.js +23 -0
- package/lib/shared/bundler/webpack/plugins.js +3 -1
- package/lib/shared/bundler/webpack/statsConfig.js +11 -2
- package/lib/shared/commands-utils/spawnSyncIO.js +5 -5
- package/lib/shared/pre_process/runPreProcess.js +58 -0
- package/lib/shared/server/mockApiHandler.js +1 -1
- package/npm-shrinkwrap.json +552 -2209
- package/package.json +8 -3
- package/result.json +1 -1
- package/unittest/index.html +33 -35
- package/lib/shared/babel/defaultBabelPlugins.js +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
# Changelog and Release Notes
|
|
2
2
|
|
|
3
|
+
## v0.0.2 (28-04-2023)
|
|
4
|
+
|
|
5
|
+
**Features:-**
|
|
6
|
+
|
|
7
|
+
- `devModeContentHashAllowedTypes` support added for some project there will be a need for hash even though they run dev mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devModeContentHashAllowedTypes)
|
|
8
|
+
- `devLikeHash` support for disable content hash for file names in production mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devLikeHash)
|
|
9
|
+
- `disableReactDevWarning` disable react dev warning such as prop-type warnings will be removed in dev mode build or server. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#disableReactDevWarning) can be enabled via `--disable_react_dev_warning` too.
|
|
10
|
+
- `statsLogConfig` support to customize default webpack log after build finished. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#statsLogConfig) can be enabled via `--disable_react_dev_warning` too.
|
|
11
|
+
- `enableChunkHash` renamed as `enableFileNameHashing`
|
|
12
|
+
|
|
13
|
+
- `pre_processor` command to run the preprocessor.js file.preProcessor runs in build, start, buildEs, buildLib commands bu default. and we have watch mode support as well with the option (`-w`)
|
|
14
|
+
- `createSeparateSmap` flag `source_map_enable` renamed as `enable_smap`
|
|
15
|
+
- `removeAttribute` option changes as `babelCustomizations.removeAttribute`
|
|
16
|
+
- `removePropTypes` support for remove the prop types package in the output build.
|
|
17
|
+
- `devConsoleExclude` support for remove the _console statements_ such as _console.log_, _console.warn_ in the output build.
|
|
18
|
+
- `manifestJson` default value set as false.
|
|
19
|
+
- `customAttributes` support for add attributes to html, link , script tag in the output build.
|
|
20
|
+
|
|
3
21
|
## v0.0.1 (18-04-2023)
|
|
22
|
+
|
|
4
23
|
First Release
|
|
5
24
|
**Features:-**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
25
|
+
|
|
26
|
+
- 'start' command to run react app
|
|
27
|
+
- 'build' command to create build for react app
|
|
28
|
+
- 'build:lib' command to create lib for react library
|
|
29
|
+
- 'build:es' command to create es for react library
|
|
30
|
+
- 'templates' command to create es for react library
|
|
@@ -6,7 +6,9 @@ The following documentation provides an overview of the configuration options av
|
|
|
6
6
|
|
|
7
7
|
## Global Configuration
|
|
8
8
|
|
|
9
|
-
### context
|
|
9
|
+
### context
|
|
10
|
+
|
|
11
|
+
> Type: (string)
|
|
10
12
|
|
|
11
13
|
Specifies the context of the application. The default value is `'app'`.
|
|
12
14
|
<br>When using your dev url will work with this.
|
|
@@ -14,50 +16,116 @@ http://localhost:9090/app
|
|
|
14
16
|
|
|
15
17
|
You can change this with cli option `--context`, Example: `--context=my-app`.
|
|
16
18
|
|
|
17
|
-
### devtool
|
|
19
|
+
### devtool
|
|
20
|
+
|
|
21
|
+
> Type: (string)
|
|
18
22
|
|
|
19
23
|
Specifies the devtool option for source mapping. The default value is `'hidden-cheap-source-map'`. you can refer more value form webpack document.
|
|
20
24
|
|
|
21
|
-
###
|
|
25
|
+
### enableFileNameHashing
|
|
26
|
+
|
|
27
|
+
> Type: (boolean)
|
|
22
28
|
|
|
23
29
|
Specifies whether to enable chunk hash for file names. The default value is `false`.
|
|
24
30
|
|
|
25
31
|
You can change this via cli option `--enable_hash`,
|
|
26
32
|
|
|
27
|
-
###
|
|
33
|
+
### statsLogConfig
|
|
34
|
+
|
|
35
|
+
> Type: (string | object)
|
|
36
|
+
|
|
37
|
+
to customize default webpack log after build finished.
|
|
38
|
+
|
|
39
|
+
You can change this via cli option `--enable_hash`,
|
|
40
|
+
|
|
41
|
+
### devModeContentHashAllowedTypes
|
|
42
|
+
|
|
43
|
+
> Type: (object)
|
|
44
|
+
|
|
45
|
+
> NOTE: this feature enabled from v 0.0.2
|
|
46
|
+
|
|
47
|
+
In some cases or project there will be a need for hash even though they run dev mode. this option enables that feature.
|
|
48
|
+
Mostly reason for this is multiple assets have same name. Example two different Image have same name.
|
|
49
|
+
It was type of object you can specify which type of asset needs to be as hash in dev mode.
|
|
50
|
+
Example: (below config is default)
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"image": true,
|
|
55
|
+
"font": true,
|
|
56
|
+
"svg": true,
|
|
57
|
+
"audio": true,
|
|
58
|
+
"video": true
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### devLikeHash
|
|
63
|
+
|
|
64
|
+
> Type: (boolean)
|
|
65
|
+
|
|
66
|
+
> NOTE: this feature enabled from v 0.0.2
|
|
67
|
+
|
|
68
|
+
Specifies whether to disable chunk hash for file names in production mode. The default value is `false`.
|
|
69
|
+
Use case: in some projects there is a need for run production build in dev server for testing. this option will provide that feature
|
|
70
|
+
|
|
71
|
+
You can change this via cli option `--dev_like_hash`,
|
|
72
|
+
|
|
73
|
+
### disableReactDevWarning
|
|
74
|
+
|
|
75
|
+
> Type: (boolean)
|
|
76
|
+
|
|
77
|
+
> NOTE: this feature enabled from v 0.0.2
|
|
78
|
+
|
|
79
|
+
Specifies whether to disable react dev warning such as prop-type warnings will be removed in dev mode build or server.
|
|
80
|
+
|
|
81
|
+
You can change this via cli option `--disable_react_dev_warning`,
|
|
82
|
+
|
|
83
|
+
### bundleAnalyze
|
|
84
|
+
|
|
85
|
+
> Type: (boolean)
|
|
28
86
|
|
|
29
87
|
Specifies whether to generate bundle analysis reports. The default value is `false`.
|
|
30
88
|
When enabled `report.html` will be created. that report.html will have an interactive grid visualization of the contents of all your bundles. for more https://www.npmjs.com/package/webpack-bundle-analyzer we internally using this.
|
|
31
89
|
|
|
32
90
|
You can change this via cli option `--bundle_analyze`.
|
|
33
91
|
|
|
34
|
-
### enableMockReplace
|
|
92
|
+
### enableMockReplace
|
|
93
|
+
|
|
94
|
+
> Type: (boolean)
|
|
35
95
|
|
|
36
96
|
Specifies whether to enable mock replacement in `index.html` for random `dir` and random `locale`. when you enable RTL split or i18n split (your see configuration for rtl and i18n later). The default value is `false`.
|
|
37
97
|
|
|
38
98
|
You can change this via cli option `--enable_mock_replace`.
|
|
39
99
|
|
|
40
|
-
### noPublicPath
|
|
100
|
+
### noPublicPath
|
|
101
|
+
|
|
102
|
+
> Type: (boolean)
|
|
41
103
|
|
|
42
104
|
Specifies whether to exclude the public path from asset URLs. The default value is `false`.
|
|
43
105
|
With set as `true` in final output domain will not be added only relative path will used for download resources like js, css ...etc.
|
|
44
106
|
|
|
45
107
|
You can change this via cli option `--no_public_path`.
|
|
46
108
|
|
|
47
|
-
### output
|
|
109
|
+
### output
|
|
110
|
+
|
|
111
|
+
> Type: (string)
|
|
48
112
|
|
|
49
113
|
Specifies the output directory for the build or bundled assets. The default value is `'build'`.
|
|
50
114
|
this option is for specify output folder path, where bundled assets placed or will be generated.
|
|
51
115
|
|
|
52
116
|
You can change this via cli option `--output`.
|
|
53
117
|
|
|
54
|
-
### mode
|
|
118
|
+
### mode
|
|
119
|
+
|
|
120
|
+
> Type: (string)
|
|
55
121
|
|
|
56
122
|
Specifies the mode for the application build. Mode are either `dev` or `prod` for devServer or Build. The default value is `null` indicating that the mode will be determined by the build tool or framework. Which means for devServer default value will be `dev` and for Build default value will be `prod`.
|
|
57
123
|
|
|
58
124
|
You can change this via cli option `--mode=dev`.
|
|
59
125
|
|
|
60
|
-
### printProgress
|
|
126
|
+
### printProgress
|
|
127
|
+
|
|
128
|
+
> Type: (boolean)
|
|
61
129
|
|
|
62
130
|
Specifies whether to print build progress information. The default value is `false`.
|
|
63
131
|
This is only for debugging purposes.
|
|
@@ -66,39 +134,53 @@ You can change this via cli option `--print_progress`.
|
|
|
66
134
|
|
|
67
135
|
## Server Configuration
|
|
68
136
|
|
|
69
|
-
### server.httpsCerts
|
|
137
|
+
### server.httpsCerts
|
|
138
|
+
|
|
139
|
+
> Type: (string)
|
|
70
140
|
|
|
71
141
|
Specifies the path to the HTTPS certificates used by the server. The default value is `'@zohodesk-private/client_dev_cert'`.
|
|
72
142
|
|
|
73
|
-
### server.host
|
|
143
|
+
### server.host
|
|
144
|
+
|
|
145
|
+
> Type: (string)
|
|
74
146
|
|
|
75
147
|
Specifies the hostname for the server. The default value is the result of the `hostname()` function.
|
|
76
148
|
|
|
77
|
-
### server.port
|
|
149
|
+
### server.port
|
|
150
|
+
|
|
151
|
+
> Type: (number)
|
|
78
152
|
|
|
79
153
|
Specifies the port number on which the server will listen. The default value is `9090`.
|
|
80
154
|
|
|
81
155
|
You can change this via cli option `--port=9090`.
|
|
82
156
|
|
|
83
|
-
### server.domain
|
|
157
|
+
### server.domain
|
|
158
|
+
|
|
159
|
+
> Type: (string)
|
|
84
160
|
|
|
85
161
|
Specifies the domain for the server. The default value is `'tsi'`.
|
|
86
162
|
|
|
87
163
|
You can change this via cli option `--domain=tsi`.
|
|
88
164
|
|
|
89
|
-
### server.disableContextURL
|
|
165
|
+
### server.disableContextURL
|
|
166
|
+
|
|
167
|
+
> Type: (boolean)
|
|
90
168
|
|
|
91
169
|
Specifies whether to disable the context URL feature. The default value is `false`.
|
|
92
170
|
|
|
93
171
|
## Mock Server Configuration
|
|
94
172
|
|
|
95
|
-
### mockServer.enable
|
|
173
|
+
### mockServer.enable
|
|
174
|
+
|
|
175
|
+
> Type: (boolean)
|
|
96
176
|
|
|
97
177
|
Specifies whether the mock server functionality is enabled or disabled. The default value is `false`.
|
|
98
178
|
|
|
99
179
|
You can change this via cli option `--enable_mock`.
|
|
100
180
|
|
|
101
|
-
### mockServer.separateSeverPort
|
|
181
|
+
### mockServer.separateSeverPort
|
|
182
|
+
|
|
183
|
+
> Type: (number)
|
|
102
184
|
|
|
103
185
|
Specifies the separate server port for the mock API server. The default value is `null`.
|
|
104
186
|
|
|
@@ -107,17 +189,23 @@ like this `cbt mock_server` more details [here]()
|
|
|
107
189
|
|
|
108
190
|
You can change this via cli option `--mock_port=5000`.
|
|
109
191
|
|
|
110
|
-
### mockServer.disableNodemon
|
|
192
|
+
### mockServer.disableNodemon
|
|
193
|
+
|
|
194
|
+
> Type: (boolean)
|
|
111
195
|
|
|
112
196
|
Specifies whether to disable nodemon for the mock server. The default value is `false`.
|
|
113
197
|
|
|
114
198
|
You can change this via cli option `--disable_nodemon`.
|
|
115
199
|
|
|
116
|
-
### mockServer.mockEntryFile
|
|
200
|
+
### mockServer.mockEntryFile
|
|
201
|
+
|
|
202
|
+
> Type: (string)
|
|
117
203
|
|
|
118
204
|
Specifies the entry file for the mock API server. The default value is `'mockapi/index.js'`.
|
|
119
205
|
|
|
120
|
-
### mockServer.mockPrefix
|
|
206
|
+
### mockServer.mockPrefix
|
|
207
|
+
|
|
208
|
+
> Type: (string)
|
|
121
209
|
|
|
122
210
|
Specifies the prefix for the mock API routes. The default value is `'/api'`.
|
|
123
211
|
|
|
@@ -125,7 +213,9 @@ You can change this via cli option `--mock_prefix=/api`.
|
|
|
125
213
|
|
|
126
214
|
## CSS Configuration
|
|
127
215
|
|
|
128
|
-
### css.classNameOptions.customizations
|
|
216
|
+
### css.classNameOptions.customizations
|
|
217
|
+
|
|
218
|
+
> Type: (array)
|
|
129
219
|
|
|
130
220
|
Specifies an array of customizations for generating CSS class names. Each customization rule is represented as an object with the following properties:
|
|
131
221
|
|
|
@@ -133,55 +223,77 @@ Specifies an array of customizations for generating CSS class names. Each custom
|
|
|
133
223
|
- `blob` (string): Specifies the pattern for generating class names.
|
|
134
224
|
- `patterns` (array): Specifies the file patterns to which the customization rule should be applied.
|
|
135
225
|
|
|
136
|
-
### css.classNameOptions.classNamePrefix
|
|
226
|
+
### css.classNameOptions.classNamePrefix
|
|
227
|
+
|
|
228
|
+
> Type: (string)
|
|
137
229
|
|
|
138
230
|
Specifies the prefix to be added to all generated class names. The default value is `'zd'`.
|
|
139
231
|
|
|
140
|
-
### css.plugins
|
|
232
|
+
### css.plugins
|
|
233
|
+
|
|
234
|
+
> Type: (object)
|
|
141
235
|
|
|
142
236
|
Specifies the configuration options for PostCSS plugins. Each plugin is represented as a key-value pair, where the key is the plugin name and the value is an object containing plugin-specific options.
|
|
143
237
|
|
|
144
238
|
For more details [here](docs/CSSCustomPluginsDocumentation.md)
|
|
145
239
|
|
|
146
|
-
### css.customPlugins
|
|
240
|
+
### css.customPlugins
|
|
241
|
+
|
|
242
|
+
> Type: (array)
|
|
147
243
|
|
|
148
244
|
Specifies an array of custom CSS plugins to be used in the build process. you can specify which ever postcss plugin in this array.
|
|
149
245
|
|
|
150
246
|
## Internationalization (i18n) Configuration
|
|
151
247
|
|
|
152
|
-
### i18nChunkSplit.chunkSplitEnable
|
|
248
|
+
### i18nChunkSplit.chunkSplitEnable
|
|
249
|
+
|
|
250
|
+
> Type: (boolean)
|
|
153
251
|
|
|
154
252
|
Specifies whether to enable chunk splitting for internationalization. The default value is `false`.
|
|
155
253
|
|
|
156
254
|
You can change this via cli option `--i18n_split`.
|
|
157
255
|
|
|
158
|
-
### i18nChunkSplit.disableDefault
|
|
256
|
+
### i18nChunkSplit.disableDefault
|
|
257
|
+
|
|
258
|
+
> Type: (boolean)
|
|
159
259
|
|
|
160
260
|
Specifies whether to disable the default internationalization chunk. The default value is `false`.
|
|
161
261
|
|
|
162
|
-
### i18nChunkSplit.templateLabel
|
|
262
|
+
### i18nChunkSplit.templateLabel
|
|
263
|
+
|
|
264
|
+
> Type: (string)
|
|
163
265
|
|
|
164
266
|
Specifies the template label for internationalization chunk splitting in Initial HTML file . The default value is `'{{--user-locale}}'`.
|
|
165
267
|
|
|
166
|
-
### i18nChunkSplit.localeVarName
|
|
268
|
+
### i18nChunkSplit.localeVarName
|
|
269
|
+
|
|
270
|
+
> Type: (string)
|
|
167
271
|
|
|
168
272
|
Specifies the variable name to store the user's locale. The default value is `'document.documentElement.lang'`.
|
|
169
273
|
|
|
170
|
-
### i18nChunkSplit.jsonpFunc
|
|
274
|
+
### i18nChunkSplit.jsonpFunc
|
|
275
|
+
|
|
276
|
+
> Type: (string)
|
|
171
277
|
|
|
172
278
|
Specifies the JavaScript function name for loading internationalization chunks. The default value is `'console.log'`.
|
|
173
279
|
|
|
174
|
-
### i18nChunkSplit.jsResource
|
|
280
|
+
### i18nChunkSplit.jsResource
|
|
281
|
+
|
|
282
|
+
> Type: (string)
|
|
175
283
|
|
|
176
284
|
Specifies the JavaScript resource file for internationalization chunks. The default value is `null`.
|
|
177
285
|
|
|
178
|
-
### i18nChunkSplit.propertiesFolder
|
|
286
|
+
### i18nChunkSplit.propertiesFolder
|
|
287
|
+
|
|
288
|
+
> Type: (string)
|
|
179
289
|
|
|
180
290
|
Specifies the folder containing the properties files for internationalization chunks. The default value is `null`.
|
|
181
291
|
|
|
182
292
|
## Public Folders Configuration
|
|
183
293
|
|
|
184
|
-
### publicFolders
|
|
294
|
+
### publicFolders
|
|
295
|
+
|
|
296
|
+
> Type: (array)
|
|
185
297
|
|
|
186
298
|
Specifies the public folders to be copied to the build output directory. The value is an array of file paths and objects representing source and target paths.
|
|
187
299
|
|
|
@@ -201,7 +313,9 @@ By configuring the `publicFolders` array, you can ensure that the specified publ
|
|
|
201
313
|
|
|
202
314
|
## Application Configuration
|
|
203
315
|
|
|
204
|
-
### app.entryFile
|
|
316
|
+
### app.entryFile
|
|
317
|
+
|
|
318
|
+
> Type: (string)
|
|
205
319
|
|
|
206
320
|
Specifies the entry file for the application. The default value is `'src/index.js'`.
|
|
207
321
|
|
|
@@ -209,30 +323,41 @@ You can change this with cli option `--entry`, Example: `--entry=src/index.js`.
|
|
|
209
323
|
|
|
210
324
|
## Resolve Configuration Documentation
|
|
211
325
|
|
|
212
|
-
### resolve
|
|
326
|
+
### resolve
|
|
327
|
+
|
|
328
|
+
> Type: (object)
|
|
213
329
|
|
|
214
330
|
Specifies the configuration options allows you to configure module resolution and aliases for your project.
|
|
215
331
|
|
|
216
|
-
### resolve.preferLocalFirst
|
|
332
|
+
### resolve.preferLocalFirst
|
|
333
|
+
|
|
334
|
+
> Type: (boolean)
|
|
217
335
|
|
|
218
336
|
Specifies whether local modules should take precedence over globally installed modules during module resolution. When set to `true`, local modules will be prioritized.(CBT will prioritize local modules over globally installed ones.) The default value is `false`.
|
|
219
337
|
|
|
220
|
-
### resolve.defaultAlias
|
|
338
|
+
### resolve.defaultAlias
|
|
339
|
+
|
|
340
|
+
> Type: (boolean)
|
|
221
341
|
|
|
222
342
|
Specifies whether to use the default alias configuration. When set to `true`, CBT applies default alias rules to enhance module resolution. The default value is `true`.
|
|
223
343
|
|
|
224
|
-
### resolve.moduleResolvePath
|
|
344
|
+
### resolve.moduleResolvePath
|
|
345
|
+
|
|
346
|
+
> Type: (string)
|
|
225
347
|
|
|
226
348
|
Specifies the path to resolve modules. The default value is `''`. This option sets the base path for resolving module imports.
|
|
227
349
|
When empty string given we use default packages that are provided By CBT.
|
|
228
|
-
When some package name given we first search for it locally then we will
|
|
229
|
-
|
|
350
|
+
When some package name given we first search for it locally then we will check for globally. So When you use this option you will have an option that use global packages that are use full in mono repo packages.
|
|
351
|
+
|
|
352
|
+
> NOTE: Currently lerna --hoist not tested But we will added it in future.
|
|
230
353
|
|
|
231
354
|
You can change this with cli option `--module_resolve_path`
|
|
232
355
|
|
|
233
356
|
> NOTE: If you do not need default packages form CBT you can set this option to `'node_modules'`.
|
|
234
357
|
|
|
235
|
-
### resolve.alias
|
|
358
|
+
### resolve.alias
|
|
359
|
+
|
|
360
|
+
> Type: (object)
|
|
236
361
|
|
|
237
362
|
Allows you to define custom aliases for module resolution. Each key-value pair in the `alias` object represents an alias mapping, where the key is the original module path and the value is the replacement module path.
|
|
238
363
|
|
|
@@ -246,144 +371,183 @@ Examples will be separate document.
|
|
|
246
371
|
|
|
247
372
|
## HTML Template Configuration
|
|
248
373
|
|
|
249
|
-
### htmlTemplate.templateFile
|
|
374
|
+
### htmlTemplate.templateFile
|
|
375
|
+
|
|
376
|
+
> Type: (string)
|
|
250
377
|
|
|
251
378
|
Specifies the HTML template file for the application. The default value is `'src/index.html'`.
|
|
252
379
|
|
|
253
380
|
You can change this with cli option `--initial_html=src/index.html`
|
|
254
381
|
|
|
255
|
-
### htmlTemplate.minify
|
|
382
|
+
### htmlTemplate.minify
|
|
383
|
+
|
|
384
|
+
> Type: (null|Object)
|
|
256
385
|
|
|
257
386
|
Specifies options for minifying the HTML template. The default value is `null`.
|
|
258
387
|
|
|
259
388
|
For more [details](https://github.com/jantimon/html-webpack-plugin#minification)
|
|
260
389
|
|
|
261
|
-
### htmlTemplate.inject
|
|
390
|
+
### htmlTemplate.inject
|
|
391
|
+
|
|
392
|
+
> Type: (boolean)
|
|
262
393
|
|
|
263
394
|
Specifies whether to inject assets into the HTML template. The default value is `true`.
|
|
264
395
|
|
|
265
396
|
## Embedded Functional Components (EFC) Configuration
|
|
266
397
|
|
|
267
|
-
### efc.hasEFC
|
|
398
|
+
### efc.hasEFC
|
|
399
|
+
|
|
400
|
+
> Type: (boolean)
|
|
268
401
|
|
|
269
402
|
Specifies whether the application has Embedded Functional Components. The default value is `false`.
|
|
270
403
|
|
|
271
404
|
You can change this with cli option `--enable_efc`
|
|
272
405
|
|
|
273
|
-
### efc.entryPointName
|
|
406
|
+
### efc.entryPointName
|
|
407
|
+
|
|
408
|
+
> Type: (string)
|
|
274
409
|
|
|
275
410
|
Specifies the entry point name for the Embedded Functional Components. The default value is `'efc'`.
|
|
276
411
|
|
|
277
|
-
### efc.entryFile
|
|
412
|
+
### efc.entryFile
|
|
413
|
+
|
|
414
|
+
> Type: (string)
|
|
278
415
|
|
|
279
416
|
Specifies the entry file for the Embedded Functional Components. The default value is `'src/efc.js'`.
|
|
280
417
|
|
|
281
418
|
You can change this with cli option `--efc_entry=src/efc.js`
|
|
282
419
|
|
|
283
|
-
### efc.version
|
|
420
|
+
### efc.version
|
|
421
|
+
|
|
422
|
+
> Type: (string)
|
|
284
423
|
|
|
285
424
|
Specifies the version of the Embedded Functional Components. The default value is `'v1'`.
|
|
286
425
|
|
|
287
426
|
You can change this with cli option `--efc_version=v1`
|
|
288
427
|
|
|
289
|
-
### efc.createSDkFile
|
|
428
|
+
### efc.createSDkFile
|
|
429
|
+
|
|
430
|
+
> Type: (boolean)
|
|
290
431
|
|
|
291
432
|
Specifies whether to create the Embedded Functional Components SDK file. The default value is `false`.
|
|
292
433
|
|
|
293
434
|
You can change this with cli option `--create_efc_sdk`
|
|
294
435
|
|
|
295
|
-
### efc.templateFilePath
|
|
436
|
+
### efc.templateFilePath
|
|
437
|
+
|
|
438
|
+
> Type: (string)
|
|
296
439
|
|
|
297
440
|
Specifies the template file path for the Embedded Functional Components. The default value is `'efcTemplate.js'`.
|
|
298
441
|
|
|
299
442
|
For more [details](docs/EFCFileTemplate.md)
|
|
300
443
|
|
|
301
|
-
### efc.outputFile
|
|
444
|
+
### efc.outputFile
|
|
445
|
+
|
|
446
|
+
> Type: (string)
|
|
302
447
|
|
|
303
448
|
Specifies the output file name for the Embedded Functional Components SDK. The default value is `'efc-sdk-[version].js'`.
|
|
304
449
|
|
|
305
450
|
You can change this with cli option `--efc_output=efc-sdk-[version].js`
|
|
306
451
|
|
|
307
|
-
## Babel
|
|
308
|
-
|
|
309
|
-
### babelCustomizations.browserList (null | array)
|
|
310
|
-
|
|
311
|
-
Specifies the browsers to target when transpile with Babel. The default value is `null`.
|
|
312
|
-
|
|
313
|
-
For more details [here](docs/CSSCustomPluginsDocumentation.md)
|
|
452
|
+
## Babel Customizations
|
|
314
453
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
Specifies an array of custom Babel plugins to be used in the build process.
|
|
454
|
+
The `babelCustomizations` object in the provided code represents a set of customizations that can be applied to the Babel configuration within the context of the Client Build Tool (CBT). These customizations allow you to fine-tune how JavaScript code is transpiled and transformed during the build process.
|
|
455
|
+
The documentation for the individual customizations [details](docs/BabelCustomizations.md)
|
|
318
456
|
|
|
319
457
|
## Webpack Configuration
|
|
320
458
|
|
|
321
|
-
### webpackPlugins
|
|
459
|
+
### webpackPlugins
|
|
460
|
+
|
|
461
|
+
> Type: (array)
|
|
322
462
|
|
|
323
463
|
Specifies an array of custom Webpack plugins to be used in the build process.
|
|
324
464
|
|
|
325
465
|
## Vendor Patterns Configuration
|
|
326
466
|
|
|
327
|
-
### vendorPatterns
|
|
467
|
+
### vendorPatterns
|
|
468
|
+
|
|
469
|
+
> Type: (array)
|
|
328
470
|
|
|
329
471
|
Specifies an array of patterns for vendor files. These pattern can be used for either include or exclude. this is array of glob patterns. So it would be better to think it as `.gitignore`. we internally use `'ignore'` So please check it as well for complex pattern needs.
|
|
330
472
|
|
|
331
473
|
## CDN Mapping Configuration
|
|
332
474
|
|
|
333
|
-
### cdnMapping.isCdnEnabled
|
|
475
|
+
### cdnMapping.isCdnEnabled
|
|
476
|
+
|
|
477
|
+
> Type: (boolean)
|
|
334
478
|
|
|
335
479
|
Specifies whether CDN mapping is enabled or disabled. The default value is `false`.
|
|
336
480
|
|
|
337
|
-
### cdnMapping.variableName
|
|
481
|
+
### cdnMapping.variableName
|
|
482
|
+
|
|
483
|
+
> Type: (string)
|
|
338
484
|
|
|
339
485
|
Specifies the variable name for CDN mapping. The default value is an empty string.This js statement will be used for cdn (domain that will server static assets such as js, css ) for download dynamic chunks (assets)
|
|
340
486
|
|
|
341
487
|
Example value: `window.__CDN_URL__`
|
|
342
488
|
|
|
343
|
-
### cdnMapping.cssTemplate
|
|
489
|
+
### cdnMapping.cssTemplate
|
|
490
|
+
|
|
491
|
+
> Type: (string)
|
|
344
492
|
|
|
345
493
|
Specifies the CSS template for CDN mapping. This template will be used in initial html to download initial css assets. The default value is an empty string.
|
|
346
494
|
Example value: `{{--css-cdn-domain}}`
|
|
347
495
|
|
|
348
|
-
### cdnMapping.jsTemplate
|
|
496
|
+
### cdnMapping.jsTemplate
|
|
497
|
+
|
|
498
|
+
> Type: (string)
|
|
349
499
|
|
|
350
500
|
Specifies the JavaScript template for CDN mapping. This template will be used in initial html to download initial js assets. The default value is an empty string.
|
|
351
501
|
Example value: `{{--js-cdn-domain}}`
|
|
352
502
|
|
|
353
|
-
### cdnMapping.i18nTemplate
|
|
503
|
+
### cdnMapping.i18nTemplate
|
|
504
|
+
|
|
505
|
+
> Type: (string)
|
|
354
506
|
|
|
355
507
|
Specifies the template for mapping i18n assets to CDN. This template will be used in initial html to download initial i18n assets. The default value is an empty string.
|
|
356
508
|
Example value: `{{--i18n-cdn-domain}}`
|
|
357
509
|
|
|
358
510
|
## Manifest JSON Configuration
|
|
359
511
|
|
|
360
|
-
### manifestJson.enable
|
|
512
|
+
### manifestJson.enable
|
|
513
|
+
|
|
514
|
+
> Type: (boolean)
|
|
361
515
|
|
|
362
516
|
Specifies whether to generate a manifest.json file. The default value is `true`. This will be use full in production mode identifying file hash.
|
|
363
517
|
|
|
364
518
|
## Runtime Chunk Character Configuration
|
|
365
519
|
|
|
366
|
-
### changeRuntimeChunkChar
|
|
520
|
+
### changeRuntimeChunkChar
|
|
521
|
+
|
|
522
|
+
> Type: (string)
|
|
367
523
|
|
|
368
524
|
Specifies the character used to separate runtime chunks. The default value is `'~'`.
|
|
369
525
|
|
|
370
526
|
## Service Worker Configuration
|
|
371
527
|
|
|
372
|
-
### serviceWorker.enable
|
|
528
|
+
### serviceWorker.enable
|
|
529
|
+
|
|
530
|
+
> Type: (boolean)
|
|
373
531
|
|
|
374
532
|
Specifies whether the service worker functionality is enabled or disabled. The default value is `false`.
|
|
375
533
|
|
|
376
|
-
### serviceWorker.templateFilePath
|
|
534
|
+
### serviceWorker.templateFilePath
|
|
535
|
+
|
|
536
|
+
> Type: (string)
|
|
377
537
|
|
|
378
538
|
Specifies the template file path for the service worker. The default value is `'sw.js'`.
|
|
379
539
|
|
|
380
540
|
For more [details](docs/ServiseWorkerTemplate.md)
|
|
381
541
|
|
|
382
|
-
### serviceWorker.outputFilePath
|
|
542
|
+
### serviceWorker.outputFilePath
|
|
543
|
+
|
|
544
|
+
> Type: (string)
|
|
383
545
|
|
|
384
546
|
Specifies the output file path for the service worker. The default value is `'/v1.js'`.
|
|
385
547
|
|
|
386
|
-
### serviceWorker.replaceText
|
|
548
|
+
### serviceWorker.replaceText
|
|
549
|
+
|
|
550
|
+
> Type: (string)
|
|
387
551
|
|
|
388
552
|
Specifies the text to replace in the service worker template file. The default value is `'//<!--AssetsFromBuild -->'`.
|
|
389
553
|
|
|
@@ -391,7 +555,9 @@ This documentation provides an overview of the configuration options available i
|
|
|
391
555
|
|
|
392
556
|
## Custom Chunks Configuration
|
|
393
557
|
|
|
394
|
-
### customChunks
|
|
558
|
+
### customChunks
|
|
559
|
+
|
|
560
|
+
> Type: (array)
|
|
395
561
|
|
|
396
562
|
Specifies an array of custom chunks for the application. Each chunk is represented as an object with the following properties:
|
|
397
563
|
|
package/README.md
CHANGED
|
@@ -61,6 +61,8 @@ With CBT, you can optimize your client-side development workflow, increase produ
|
|
|
61
61
|
|
|
62
62
|
The following commands are available options for the `cbt` (Client Build Tool) CLI. You can execute these commands by prefixing them with `cbt`. For example, `cbt start`.
|
|
63
63
|
|
|
64
|
+
- **preProcessor:** Runs the preProcessor.js in the app to set the variables before the build or run the dev mode.
|
|
65
|
+
|
|
64
66
|
- **start**: Starts the development server with mode support. You can specify the mode as either `dev` or `prod`. This command is used for local development and testing.
|
|
65
67
|
|
|
66
68
|
- **build**: Executes the build command with mode support. You can specify the mode as either `dev` or `prod`. This command compiles and bundles your application for deployment.
|
|
@@ -82,10 +84,31 @@ These commands provide flexibility and control over your client-side build proce
|
|
|
82
84
|
For more [Details](ConfigurationDocumentation.md)
|
|
83
85
|
# Changelog and Release Notes
|
|
84
86
|
|
|
87
|
+
## v0.0.2 (28-04-2023)
|
|
88
|
+
|
|
89
|
+
**Features:-**
|
|
90
|
+
|
|
91
|
+
- `devModeContentHashAllowedTypes` support added for some project there will be a need for hash even though they run dev mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devModeContentHashAllowedTypes)
|
|
92
|
+
- `devLikeHash` support for disable content hash for file names in production mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devLikeHash)
|
|
93
|
+
- `disableReactDevWarning` disable react dev warning such as prop-type warnings will be removed in dev mode build or server. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#disableReactDevWarning) can be enabled via `--disable_react_dev_warning` too.
|
|
94
|
+
- `statsLogConfig` support to customize default webpack log after build finished. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#statsLogConfig) can be enabled via `--disable_react_dev_warning` too.
|
|
95
|
+
- `enableChunkHash` renamed as `enableFileNameHashing`
|
|
96
|
+
|
|
97
|
+
- `pre_processor` command to run the preprocessor.js file.preProcessor runs in build, start, buildEs, buildLib commands bu default. and we have watch mode support as well with the option (`-w`)
|
|
98
|
+
- `createSeparateSmap` flag `source_map_enable` renamed as `enable_smap`
|
|
99
|
+
- `removeAttribute` option changes as `babelCustomizations.removeAttribute`
|
|
100
|
+
- `removePropTypes` support for remove the prop types package in the output build.
|
|
101
|
+
- `devConsoleExclude` support for remove the _console statements_ such as _console.log_, _console.warn_ in the output build.
|
|
102
|
+
- `manifestJson` default value set as false.
|
|
103
|
+
- `customAttributes` support for add attributes to html, link , script tag in the output build.
|
|
104
|
+
|
|
85
105
|
## v0.0.1 (18-04-2023)
|
|
106
|
+
|
|
86
107
|
First Release
|
|
87
108
|
**Features:-**
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
109
|
+
|
|
110
|
+
- 'start' command to run react app
|
|
111
|
+
- 'build' command to create build for react app
|
|
112
|
+
- 'build:lib' command to create lib for react library
|
|
113
|
+
- 'build:es' command to create es for react library
|
|
114
|
+
- 'templates' command to create es for react library
|