@zohodesk/client_build_tool 0.0.11-exp.15.4 → 0.0.11-exp.16.0
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/README.md +102 -0
- package/README_backup.md +100 -0
- package/docs/DYNAMIC_TEMPLATE_EXAMPLE.md +129 -0
- package/docs/I18N_SINGLE_FILE_MODE.md +126 -0
- package/example-single-file-config.js +59 -0
- package/lib/allCommandsConfigs.js +2 -7
- package/lib/commands/build/commandExecutor.js +1 -5
- package/lib/commands/build/config.js +2 -3
- package/lib/commands/build/optionsProcessor.js +2 -5
- package/lib/commands/build/preProcessor.js +0 -2
- package/lib/commands/buildEs/commandExecutor.js +0 -5
- package/lib/commands/buildEs/config.js +2 -3
- package/lib/commands/buildEs/preProcessor.js +0 -2
- package/lib/commands/buildLib/commandExecutor.js +0 -5
- package/lib/commands/buildLib/config.js +2 -3
- package/lib/commands/buildLib/preProcessor.js +0 -2
- package/lib/commands/mockserver/commandExecutor.js +2 -9
- package/lib/commands/mockserver/config.js +2 -3
- package/lib/commands/pre_process/commandExecutor.js +0 -2
- package/lib/commands/pre_process/config.js +2 -3
- package/lib/commands/start/commandExecutor.js +0 -2
- package/lib/commands/start/config.js +2 -3
- package/lib/commands/start/optionsProcessor.js +2 -4
- package/lib/commands/start/preProcessor.js +0 -2
- package/lib/commands/template/commandExecutor.js +0 -7
- package/lib/commands/template/config.js +2 -3
- package/lib/commands/version/commandExecutor.js +0 -3
- package/lib/commands/version/config.js +2 -3
- package/lib/commandsRouter.js +5 -21
- package/lib/index.js +0 -2
- package/lib/logger.js +0 -5
- package/lib/schemas/applyValuesToSchema/index.js +0 -8
- package/lib/schemas/applyValuesToSchema/isObject.js +0 -1
- package/lib/schemas/applyValuesToSchema/isValid.js +0 -2
- package/lib/schemas/cliArgsToObject.js +2 -6
- package/lib/schemas/defaultConfigValues.js +21 -12
- package/lib/schemas/defaultConfigValuesOnly.js +4 -7
- package/lib/schemas/deprecatedOptionsHandler.js +7 -16
- package/lib/schemas/getNpmVersion.js +0 -5
- package/lib/schemas/giveDefaultValue.js +0 -3
- package/lib/schemas/npmConfigToObject.js +2 -5
- package/lib/schemas/readOptions.js +10 -30
- package/lib/schemas/readOptionsForConfigFile.js +2 -12
- package/lib/shared/babel/addDefaultPlugins.js +0 -2
- package/lib/shared/babel/babelWebConfig.js +1 -10
- package/lib/shared/babel/babel_plugins/removeAttributesPlugin.js +0 -4
- package/lib/shared/babel/getBabelPlugin.js +2 -7
- package/lib/shared/babel/runBabelForJSFile.js +1 -4
- package/lib/shared/babel/runBabelForTsFile.js +1 -5
- package/lib/shared/bundler/webpack/common/decidePublicPath.js +0 -5
- package/lib/shared/bundler/webpack/common/libAlias.js +3 -3
- package/lib/shared/bundler/webpack/common/modeUtils.js +0 -5
- package/lib/shared/bundler/webpack/common/nameTemplates.js +11 -18
- package/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +2 -3
- package/lib/shared/bundler/webpack/configCustomLoaders.js +0 -1
- package/lib/shared/bundler/webpack/cssLoaders.js +0 -2
- package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +1 -20
- package/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/index.js +20 -25
- package/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/webpackCustomJsUrlLoader.js +4 -9
- package/lib/shared/bundler/webpack/custom_plugins/CustomScriptLoadingPlugin.js +3 -23
- package/lib/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +8 -19
- package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nGroupRuntimeModule.js +2 -6
- package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexHtmlInjectorPlugin.js +81 -0
- package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js +135 -60
- package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/utils/i18nDataLoader.js +20 -26
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +5 -26
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +13 -16
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +19 -53
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +2 -17
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +0 -13
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +11 -21
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -4
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +4 -14
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +3 -13
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +3 -12
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +2 -7
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -2
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +2 -3
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +2 -4
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +8 -13
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -14
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +0 -1
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +1 -3
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -4
- package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +5 -25
- package/lib/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +3 -10
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +1 -6
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +1 -6
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +0 -6
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +0 -1
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +0 -7
- package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +0 -1
- package/lib/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +13 -17
- package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +6 -15
- package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +4 -13
- package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +4 -6
- package/lib/shared/bundler/webpack/custom_plugins/RuntimeResourceCleanup/index.js +0 -10
- package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +0 -3
- package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +4 -20
- package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +10 -12
- package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +2 -3
- package/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +7 -20
- package/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPluginUtils.js +0 -1
- package/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +7 -10
- package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +1 -6
- package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +1 -16
- package/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +4 -11
- package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +3 -10
- package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +27 -62
- package/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +3 -15
- package/lib/shared/bundler/webpack/custom_plugins/emitAsset.js +0 -1
- package/lib/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +2 -12
- package/lib/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +2 -7
- package/lib/shared/bundler/webpack/defaultVendorPatternList.js +2 -6
- package/lib/shared/bundler/webpack/devtoolConfig.js +0 -1
- package/lib/shared/bundler/webpack/entryConfig.js +0 -4
- package/lib/shared/bundler/webpack/externals.js +0 -1
- package/lib/shared/bundler/webpack/getCSSLoaders.js +1 -6
- package/lib/shared/bundler/webpack/getFilenameFromModule.js +1 -5
- package/lib/shared/bundler/webpack/jsLoaders.js +6 -10
- package/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -2
- package/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +2 -3
- package/lib/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +3 -12
- package/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -1
- package/lib/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +2 -10
- package/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -2
- package/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -12
- package/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +1 -15
- package/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +1 -4
- package/lib/shared/bundler/webpack/loaderConfigs/i18nIdReplaceLoaderConfig.js +8 -16
- package/lib/shared/bundler/webpack/loaders/i18nIdReplaceLoader.js +22 -29
- package/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +2 -2
- package/lib/shared/bundler/webpack/loaders/workerLoader.js +8 -19
- package/lib/shared/bundler/webpack/optimizationConfig.js +5 -13
- package/lib/shared/bundler/webpack/outputConfig.js +1 -9
- package/lib/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +5 -9
- package/lib/shared/bundler/webpack/pluginConfigs/configBundleIntegrityReport.js +0 -5
- package/lib/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +4 -9
- package/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +3 -8
- package/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +1 -16
- package/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +0 -4
- package/lib/shared/bundler/webpack/pluginConfigs/configCustomScriptLoadingStrategyPlugin.js +0 -16
- package/lib/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +0 -5
- package/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -5
- package/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +2 -8
- package/lib/shared/bundler/webpack/pluginConfigs/configI18nIndexingPlugin.js +5 -9
- package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericHtmlInjector.js +19 -25
- package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericIndexPlugin.js +92 -0
- package/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +3 -9
- package/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -2
- package/lib/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +0 -7
- package/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +3 -7
- package/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +1 -5
- package/lib/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +1 -4
- package/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -4
- package/lib/shared/bundler/webpack/pluginConfigs/configRuntimeResourceCleanup.js +3 -8
- package/lib/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +1 -6
- package/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +3 -8
- package/lib/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +0 -4
- package/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +1 -8
- package/lib/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +1 -6
- package/lib/shared/bundler/webpack/plugins.js +3 -30
- package/lib/shared/bundler/webpack/resolvers.js +3 -17
- package/lib/shared/bundler/webpack/splitChunksConfig.js +2 -15
- package/lib/shared/bundler/webpack/statsConfig.js +2 -5
- package/lib/shared/bundler/webpack/tsLoaders.js +2 -4
- package/lib/shared/bundler/webpack/utils/index.js +1 -12
- package/lib/shared/bundler/webpack/utils/object-manipulation.js +2 -16
- package/lib/shared/bundler/webpack/utils/updateArrayWithDefault.js +0 -7
- package/lib/shared/bundler/webpack/webpackBuild.js +1 -8
- package/lib/shared/bundler/webpack/webpackConfig.js +0 -17
- package/lib/shared/commands-utils/doBasicRequirementCheck.js +0 -3
- package/lib/shared/commands-utils/getCliPath.js +5 -9
- package/lib/shared/commands-utils/index.js +0 -3
- package/lib/shared/commands-utils/log.js +0 -2
- package/lib/shared/commands-utils/readArgsFormCommandLine.js +0 -1
- package/lib/shared/commands-utils/readOptionFormCommandLine.js +0 -1
- package/lib/shared/commands-utils/spawnSyncIO.js +5 -13
- package/lib/shared/constants.js +9 -29
- package/lib/shared/fileUtils/copyFile.js +1 -8
- package/lib/shared/fileUtils/directoryIterator.js +0 -4
- package/lib/shared/fileUtils/watchRun.js +3 -24
- package/lib/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +1 -6
- package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +2 -3
- package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +6 -13
- package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +6 -26
- package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +6 -9
- package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +0 -3
- package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +2 -7
- package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +0 -2
- package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +4 -9
- package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +0 -10
- package/lib/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +16 -29
- package/lib/shared/postcss/custom_postcss_plugins/SelectorReplace.js +0 -17
- package/lib/shared/postcss/custom_postcss_plugins/ValueReplacer.js +4 -9
- package/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +27 -63
- package/lib/shared/postcss/filterPluginsAllowedForSpecficFile.js +5 -13
- package/lib/shared/postcss/getAllowedPostCssPlugins.js +0 -3
- package/lib/shared/postcss/getSpecificPostCssPlugin.js +7 -17
- package/lib/shared/postcss/runPostCssForCssFile.js +1 -9
- package/lib/shared/pre_process/runPreProcess.js +0 -11
- package/lib/shared/server/configWebpackDevMiddleware.js +1 -8
- package/lib/shared/server/corsHandling.js +2 -6
- package/lib/shared/server/getIp.js +1 -7
- package/lib/shared/server/getServerURL.js +0 -6
- package/lib/shared/server/httpsOptions.js +0 -11
- package/lib/shared/server/initExpressApp.js +1 -4
- package/lib/shared/server/initialHTMLHandling.js +7 -16
- package/lib/shared/server/mockApiHandler.js +8 -16
- package/lib/shared/server/mockServer.js +0 -7
- package/lib/shared/server/serveContextFiles.js +1 -5
- package/lib/shared/server/serverBywebpackDevMiddleware.js +4 -9
- package/lib/shared/server/startHttpServer.js +0 -3
- package/lib/shared/server/startHttpsServer.js +1 -9
- package/lib/shared/server/unwanted/addHttp2Server.js +2 -7
- package/lib/shared/server/unwanted/configWebpackDevMiddleware.js +1 -8
- package/lib/shared/server/unwanted/mockApiSupport.js +0 -2
- package/lib/shared/server/unwanted/websocketMockSetup.js +1 -7
- package/lib/shared/server/urlConcat.js +3 -8
- package/lib/shared/utils/requireLocalOrGlobal.js +10 -25
- package/lib/shared/utils/versionPrint.js +1 -6
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/packages/client_build_tool/test-i18n-config.js +22 -0
package/README.md
CHANGED
|
@@ -98,3 +98,105 @@ fixes :-
|
|
|
98
98
|
|
|
99
99
|
- preload plc undefined url fixed
|
|
100
100
|
|
|
101
|
+
# Changelog and Release Notes
|
|
102
|
+
|
|
103
|
+
- remove babel-plugin-module-resolver dependencies
|
|
104
|
+
|
|
105
|
+
**Adjustments:-**
|
|
106
|
+
- Public Folder configuration is separated for development and production
|
|
107
|
+
|
|
108
|
+
**Bug Fix:-**
|
|
109
|
+
- Fixed the issue where the build log was not visible when `stats (bundle integrity)` was enabled. The problem was resolved by adding an error check in the `bundleIntegrity plugin`.
|
|
110
|
+
- Removed the babel-plugin-module-resolver dependency to resolve the alias resolution issue in the application.
|
|
111
|
+
- Fixed the issue where a space in the variable name causes it to return an undefined value.
|
|
112
|
+
- Fixed the URL path generation issue that occurred while using context in the development setup.
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# v0.0.11
|
|
117
|
+
|
|
118
|
+
# v0.0.10 (12-05-2025)
|
|
119
|
+
**Feature:-**
|
|
120
|
+
- `alias` support for `build:es` and `build:lib`
|
|
121
|
+
- Add babel-plugin-module-resolver dependencies
|
|
122
|
+
- Modify getBabelPlugin to include module resolver with aliases
|
|
123
|
+
|
|
124
|
+
**Bug Fix:-**
|
|
125
|
+
- Enhance runBabelForTSFile to handle both .tsx and .ts file extensions
|
|
126
|
+
- Update mockApiHandler to ensure mock function is called correctly
|
|
127
|
+
|
|
128
|
+
**Change:-**
|
|
129
|
+
- Refactor defaultConfigValues.js to include cli options for enableRTLSplit
|
|
130
|
+
|
|
131
|
+
## v0.0.9
|
|
132
|
+
|
|
133
|
+
**Feature:-**
|
|
134
|
+
- externals was added to Prevent bundling of certain imported packages and retrieve these external dependencies at runtime.
|
|
135
|
+
- to use externals, we use the following pattern in `app > externals` :
|
|
136
|
+
|
|
137
|
+
For example
|
|
138
|
+
```
|
|
139
|
+
externals: {
|
|
140
|
+
<key> : <value>
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## v0.0.6 (4-09-2023)
|
|
145
|
+
|
|
146
|
+
**Feature:-**
|
|
147
|
+
- Generating bundle integrity report json file for the build assets only in production mode. To use this feature we need to add `stats > enable` or cli flags `enable_stats`.
|
|
148
|
+
- Added Resource Cleanup plugin to cleanup resource retained by build tool. this plugin is controlled by efc flag resourcecleanup flag.
|
|
149
|
+
- added support for using regex expression to get group of chunks chunkId via Resource Hint plugin prefetch/preload hook.
|
|
150
|
+
only will be activate when `resourceHints` => `allowPrefetchingMultipleChunks` as `true`
|
|
151
|
+
- added support for glob pattern for custom chunks split logic.
|
|
152
|
+
- added options to split chunks base config in the key `app` => `customChunksBaseConfig` as object
|
|
153
|
+
|
|
154
|
+
**Change:-**
|
|
155
|
+
- i18n name not generated issue fix.
|
|
156
|
+
- public path not correctly set issue fix.
|
|
157
|
+
- changing plugin hook stages in i18nRuntimePlugin and sourceMapPlugin
|
|
158
|
+
## v0.0.5 (6-08-2023)
|
|
159
|
+
|
|
160
|
+
**Changes:--**
|
|
161
|
+
- Typo fix in i18nRuntimeDealerPlugin.js
|
|
162
|
+
- fixing some bugs in resolvers.js file
|
|
163
|
+
|
|
164
|
+
## v0.0.3 (1-08-2023)
|
|
165
|
+
|
|
166
|
+
**Changes:--**
|
|
167
|
+
- `devtool` default value changed from `hidden-cheap-source-map` to `source-map`
|
|
168
|
+
- unwanted files deleted from build
|
|
169
|
+
|
|
170
|
+
**Issue Fix:--**
|
|
171
|
+
- The issue with the source map not being created in the build has been fixed."
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## v0.0.2 (28-04-2023)
|
|
175
|
+
|
|
176
|
+
**Features:-**
|
|
177
|
+
|
|
178
|
+
- `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)
|
|
179
|
+
- `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)
|
|
180
|
+
- `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.
|
|
181
|
+
- `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.
|
|
182
|
+
- `enableChunkHash` renamed as `enableFileNameHashing`
|
|
183
|
+
|
|
184
|
+
- `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`)
|
|
185
|
+
- `createSeparateSmap` flag `source_map_enable` renamed as `enable_smap`
|
|
186
|
+
- `removeAttribute` option changes as `babelCustomizations.removeAttribute`
|
|
187
|
+
- `removePropTypes` support for remove the prop types package in the output build.
|
|
188
|
+
- `devConsoleExclude` support for remove the _console statements_ such as _console.log_, _console.warn_ in the output build.
|
|
189
|
+
- `manifestJson` default value set as false.
|
|
190
|
+
- `customAttributes` support for add attributes to html, link , script tag in the output build.
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
## v0.0.1 (18-04-2023)
|
|
194
|
+
|
|
195
|
+
First Release
|
|
196
|
+
**Features:-**
|
|
197
|
+
|
|
198
|
+
- 'start' command to run react app
|
|
199
|
+
- 'build' command to create build for react app
|
|
200
|
+
- 'build:lib' command to create lib for react library
|
|
201
|
+
- 'build:es' command to create es for react library
|
|
202
|
+
- 'templates' command to create es for react library
|
package/README_backup.md
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Client Build Tool
|
|
2
|
+
|
|
3
|
+
This is a build tool for react based web applications.
|
|
4
|
+
|
|
5
|
+
Supported and Tested Environment
|
|
6
|
+
|
|
7
|
+
| Name | Version |
|
|
8
|
+
| :--: | :------: |
|
|
9
|
+
| node | v18.11.0 |
|
|
10
|
+
| npm | 8.19.2 |
|
|
11
|
+
|
|
12
|
+
OS : Mac , ubuntu
|
|
13
|
+
|
|
14
|
+
# client_build_tool
|
|
15
|
+
|
|
16
|
+
A CLI tool for build modern web application and libraries
|
|
17
|
+
|
|
18
|
+
# Installation
|
|
19
|
+
|
|
20
|
+
Below Steps:-
|
|
21
|
+
|
|
22
|
+
> `npm i -g @zohodesk/client_build_tool`
|
|
23
|
+
|
|
24
|
+
# Usage
|
|
25
|
+
|
|
26
|
+
## Step 1
|
|
27
|
+
|
|
28
|
+
> `cbt template app <your-project-folder> && cd <your-project-folder>`
|
|
29
|
+
|
|
30
|
+
## Step 2
|
|
31
|
+
|
|
32
|
+
Now to run app
|
|
33
|
+
|
|
34
|
+
> `npm run start`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
Happy Code :>) 🤟
|
|
39
|
+
|
|
40
|
+
# "Client Build Tool (CBT): Streamline and Optimize Your Client-side Build Process"
|
|
41
|
+
|
|
42
|
+
## Description:
|
|
43
|
+
|
|
44
|
+
CBT is a powerful client-side build tool designed to streamline and optimize your development workflow. With CBT, you can effortlessly manage and configure your project's build process, automating tasks, and improving efficiency. It provides an intuitive interface and a comprehensive set of features to simplify the build pipeline, allowing you to focus more on coding and less on tedious configuration.
|
|
45
|
+
|
|
46
|
+
## Key Features:
|
|
47
|
+
|
|
48
|
+
- **Integrated Dev Server:** Run your application locally with a built-in development server for quick feedback and real-time updates.
|
|
49
|
+
- **Mock API Server:** Seamlessly integrate a mock API server to simulate backend interactions during development.
|
|
50
|
+
- **Intelligent CSS Processing:** Automatically process and optimize CSS files, including customizable class name generation and advanced postcss plugins.
|
|
51
|
+
- **Internationalization Support:** Easily manage internationalization (i18n) with efficient chunk splitting and language-specific resource loading.
|
|
52
|
+
- **CDN Mapping:** Effortlessly map assets to a Content Delivery Network (CDN) for faster delivery and improved performance.
|
|
53
|
+
- **Comprehensive Configuration:** Fine-tune your build process with extensive configuration options, including source maps, Babel customizations, and more.
|
|
54
|
+
- **Service Worker Integration:** Enable service worker functionality for offline support and improved caching capabilities.
|
|
55
|
+
- **Customizable Build Artifacts:** Define custom chunks, modify HTML templates, and generate a manifest.json file for better control over your build output.
|
|
56
|
+
- **User-friendly Interface:** CBT provides a user-friendly interface, making it easy to configure, customize, and monitor your build process.
|
|
57
|
+
|
|
58
|
+
With CBT, you can optimize your client-side development workflow, increase productivity, and deliver high-quality applications faster. Start using CBT today and experience the power of efficient and streamlined client-side builds.
|
|
59
|
+
|
|
60
|
+
# Commands
|
|
61
|
+
|
|
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
|
+
|
|
64
|
+
- **preProcessor:** Runs the preProcessor.js in the app to set the variables before the build or run the dev mode.
|
|
65
|
+
|
|
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.
|
|
67
|
+
|
|
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.
|
|
69
|
+
|
|
70
|
+
- **build:lib**: Transpile the `src` folder to the `lib` folder, generating CommonJS modules. This command is specifically designed for building libraries that require CommonJS module format.
|
|
71
|
+
|
|
72
|
+
- **build:es**: Transpile the `src` folder to the `es` folder, generating modules using import statements. This command is useful for building libraries that use ECMAScript module syntax.
|
|
73
|
+
|
|
74
|
+
- **version**: Prints the version of the CBT CLI tool.
|
|
75
|
+
|
|
76
|
+
- **template**: Creates an initial template or skeleton for your project. You can specify the option as `app`. This command sets up a basic project structure and configuration files to get you started quickly.
|
|
77
|
+
|
|
78
|
+
- **mock:server**: Starts an external mock API server. This command enables you to run a separate server specifically for mocking API responses during development and testing.
|
|
79
|
+
|
|
80
|
+
> Note: Make sure to replace `start` in the examples above with the actual command or script that you use to run the Client Build Tool CLI.
|
|
81
|
+
|
|
82
|
+
These commands provide flexibility and control over your client-side build process, allowing you to start the development server, build your application, transpile libraries, create templates, run a mock API server, and more.
|
|
83
|
+
|
|
84
|
+
For more [Details](ConfigurationDocumentation.md)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
version details :-
|
|
88
|
+
|
|
89
|
+
# 0.0.8
|
|
90
|
+
|
|
91
|
+
- Main version
|
|
92
|
+
|
|
93
|
+
# 0.0.9
|
|
94
|
+
|
|
95
|
+
fixes :-
|
|
96
|
+
|
|
97
|
+
- service worker wrong i18n entry fixed
|
|
98
|
+
|
|
99
|
+
- preload plc undefined url fixed
|
|
100
|
+
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Dynamic singleFileTemplate Configuration
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
The `singleFileTemplate` option now supports both static strings and dynamic functions, allowing different filename patterns based on build mode.
|
|
5
|
+
|
|
6
|
+
## Configuration Options
|
|
7
|
+
|
|
8
|
+
### 1. Static Template (Simple)
|
|
9
|
+
```javascript
|
|
10
|
+
i18nIndexing: {
|
|
11
|
+
singleFileTemplate: '[locale].js' // Always uses this format
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 2. Dynamic Template with Function
|
|
16
|
+
```javascript
|
|
17
|
+
i18nIndexing: {
|
|
18
|
+
isDevelopment: isDevelopment, // Pass from your app
|
|
19
|
+
singleFileTemplate: (isDev) =>
|
|
20
|
+
isDev ? '[locale].js' : '[locale].[contenthash].js'
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### 3. Inline Conditional (Pre-resolved)
|
|
25
|
+
```javascript
|
|
26
|
+
i18nIndexing: {
|
|
27
|
+
isDevelopment: isDevelopment, // Pass from your app
|
|
28
|
+
singleFileTemplate: isDevelopment
|
|
29
|
+
? '[locale].js'
|
|
30
|
+
: '[locale].[contenthash].js'
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Template Placeholders
|
|
35
|
+
|
|
36
|
+
- `[locale]` - Replaced with actual locale code (e.g., en_US, fr_FR)
|
|
37
|
+
- `[contenthash]` - Replaced with content-based hash for cache busting
|
|
38
|
+
|
|
39
|
+
## Output Examples
|
|
40
|
+
|
|
41
|
+
### Development Mode (isDevelopment = true)
|
|
42
|
+
```
|
|
43
|
+
Template: '[locale].js'
|
|
44
|
+
Output:
|
|
45
|
+
i18n/en_US.js
|
|
46
|
+
i18n/fr_FR.js
|
|
47
|
+
i18n/de_DE.js
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Production Mode (isDevelopment = false)
|
|
51
|
+
```
|
|
52
|
+
Template: '[locale].[contenthash].js'
|
|
53
|
+
Output:
|
|
54
|
+
i18n/en_US.b9ef890a.js
|
|
55
|
+
i18n/fr_FR.3452451e.js
|
|
56
|
+
i18n/de_DE.e8b84364.js
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Complete Example Configuration
|
|
60
|
+
|
|
61
|
+
```javascript
|
|
62
|
+
exports.config = {
|
|
63
|
+
context: 'src',
|
|
64
|
+
output: 'build',
|
|
65
|
+
mode: process.env.NODE_ENV || 'production',
|
|
66
|
+
|
|
67
|
+
// Pass isDevelopment from your app
|
|
68
|
+
isDevelopment: process.env.NODE_ENV === 'development',
|
|
69
|
+
|
|
70
|
+
i18nIndexing: {
|
|
71
|
+
enable: true,
|
|
72
|
+
outputFolder: 'i18n',
|
|
73
|
+
jsResourcePath: './resources/ApplicationResources.properties',
|
|
74
|
+
propertiesFolderPath: './resources',
|
|
75
|
+
numericMapPath: './numericMap.json',
|
|
76
|
+
|
|
77
|
+
// Dynamic template based on build mode
|
|
78
|
+
singleFileTemplate: function(isDevelopment) {
|
|
79
|
+
return isDevelopment ? '[locale].js' : '[locale].[contenthash].js';
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
// Or using arrow function
|
|
83
|
+
// singleFileTemplate: (isDev) => isDev ? '[locale].js' : '[locale].[contenthash].js',
|
|
84
|
+
|
|
85
|
+
// Or pre-resolved
|
|
86
|
+
// singleFileTemplate: isDevelopment ? '[locale].js' : '[locale].[contenthash].js',
|
|
87
|
+
|
|
88
|
+
singleFile: true,
|
|
89
|
+
jsonpFunc: 'var imAppI18n=',
|
|
90
|
+
htmlTemplateLabel: '{{--user-locale}}',
|
|
91
|
+
localeVarName: 'window.userLangCode',
|
|
92
|
+
generateManifest: true,
|
|
93
|
+
manifestPath: 'i18n/manifest.json'
|
|
94
|
+
|
|
95
|
+
// Note: includeContentHash is now optional when using [contenthash] in template
|
|
96
|
+
// includeContentHash: true // Not needed with [contenthash] placeholder
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Benefits
|
|
102
|
+
|
|
103
|
+
1. **Development**: Clean, readable filenames without hashes for easier debugging
|
|
104
|
+
2. **Production**: Content-hashed filenames for optimal caching
|
|
105
|
+
3. **Flexibility**: Single configuration handles both environments
|
|
106
|
+
4. **No Redundancy**: Using `[contenthash]` in template eliminates need for `includeContentHash` option
|
|
107
|
+
|
|
108
|
+
## Migration from includeContentHash
|
|
109
|
+
|
|
110
|
+
### Old Way
|
|
111
|
+
```javascript
|
|
112
|
+
singleFileTemplate: '[locale].js',
|
|
113
|
+
includeContentHash: true // Adds hash before .js
|
|
114
|
+
// Output: en_US.abc123.js
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### New Way (Recommended)
|
|
118
|
+
```javascript
|
|
119
|
+
singleFileTemplate: isDevelopment ? '[locale].js' : '[locale].[contenthash].js'
|
|
120
|
+
// Output: en_US.abc123.js (production) or en_US.js (development)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Notes
|
|
124
|
+
|
|
125
|
+
- The function receives `isDevelopment` as a boolean parameter
|
|
126
|
+
- You must pass `isDevelopment` in your main options object
|
|
127
|
+
- The `[contenthash]` placeholder is automatically replaced with the actual hash
|
|
128
|
+
- For HTML injection, the hash placeholder is removed since the exact hash isn't known at HTML generation time
|
|
129
|
+
- The manifest will map clean names to hashed versions for deployment scripts
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# I18n Single-File Mode Configuration
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Single-file mode combines numeric and dynamic i18n keys into a single JavaScript file per locale, creating a flat output structure ideal for CDN deployment.
|
|
5
|
+
|
|
6
|
+
## Configuration
|
|
7
|
+
|
|
8
|
+
```javascript
|
|
9
|
+
i18nIndexing: {
|
|
10
|
+
enable: true,
|
|
11
|
+
outputFolder: 'i18n',
|
|
12
|
+
singleFile: true,
|
|
13
|
+
singleFileTemplate: '[locale].js', // Key setting for single-file mode
|
|
14
|
+
includeContentHash: true,
|
|
15
|
+
generateManifest: true,
|
|
16
|
+
manifestPath: 'i18n/manifest.json',
|
|
17
|
+
// ... other options
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Key Options
|
|
22
|
+
|
|
23
|
+
### `singleFile: true`
|
|
24
|
+
Enables single-file mode, combining all i18n keys into one file per locale.
|
|
25
|
+
|
|
26
|
+
### `singleFileTemplate: '[locale].js'`
|
|
27
|
+
Template for single-file naming. Default: `[locale].js`
|
|
28
|
+
- `[locale]` is replaced with the actual locale code
|
|
29
|
+
- Results in files like: `en_US.js`, `fr_FR.js`
|
|
30
|
+
|
|
31
|
+
### `outputFolder: 'i18n'`
|
|
32
|
+
Base directory for all i18n files. Files are placed directly here in single-file mode.
|
|
33
|
+
|
|
34
|
+
### `includeContentHash: true`
|
|
35
|
+
Adds content hash for cache busting:
|
|
36
|
+
- Without hash: `i18n/en_US.js`
|
|
37
|
+
- With hash: `i18n/en_US.abc123.js`
|
|
38
|
+
|
|
39
|
+
### `manifestPath: 'i18n/manifest.json'`
|
|
40
|
+
Custom location for the manifest file that maps original names to hashed versions.
|
|
41
|
+
|
|
42
|
+
## Output Structure
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
build/
|
|
46
|
+
├── i18n/
|
|
47
|
+
│ ├── en_US.b9ef890a.js # Combined file with content hash
|
|
48
|
+
│ ├── fr_FR.3452451e.js
|
|
49
|
+
│ ├── de_DE.e8b84364.js
|
|
50
|
+
│ └── manifest.json # Mapping file
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Manifest Format
|
|
54
|
+
|
|
55
|
+
The manifest provides a clean mapping without paths or type suffixes:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"en_US.js": "en_US.b9ef890a.js",
|
|
60
|
+
"fr_FR.js": "fr_FR.3452451e.js",
|
|
61
|
+
"de_DE.js": "de_DE.e8b84364.js"
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## HTML Integration
|
|
66
|
+
|
|
67
|
+
The HTML injector automatically adds the appropriate script tag based on the `htmlTemplateLabel`:
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<!-- With htmlTemplateLabel: '{{--user-locale}}' -->
|
|
71
|
+
<script src="i18n/{{--user-locale}}.js"></script>
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Runtime Loading
|
|
75
|
+
|
|
76
|
+
Files are loaded using the configured `jsonpFunc`:
|
|
77
|
+
|
|
78
|
+
```javascript
|
|
79
|
+
// File content example with jsonpFunc: 'var imAppI18n='
|
|
80
|
+
var imAppI18n={"0":"Welcome","1":"Hello","dynamic.key":"Dynamic value"};
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Comparison: Single-File vs Multi-File Mode
|
|
84
|
+
|
|
85
|
+
### Single-File Mode
|
|
86
|
+
```javascript
|
|
87
|
+
singleFile: true
|
|
88
|
+
// Output: i18n/en_US.js (contains all keys)
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Multi-File Mode (Default)
|
|
92
|
+
```javascript
|
|
93
|
+
singleFile: false
|
|
94
|
+
// Output:
|
|
95
|
+
// i18n/en_US/numeric.i18n.js (numeric keys only)
|
|
96
|
+
// i18n/en_US/dynamic.i18n.js (dynamic keys only)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Benefits of Single-File Mode
|
|
100
|
+
|
|
101
|
+
1. **Fewer HTTP Requests**: One file per locale instead of multiple
|
|
102
|
+
2. **Simpler Deployment**: Flat structure is easier to manage
|
|
103
|
+
3. **CDN Friendly**: Clean paths work better with CDN caching
|
|
104
|
+
4. **Clear Manifest**: Simple key-value mapping without complex paths
|
|
105
|
+
|
|
106
|
+
## Example Configuration
|
|
107
|
+
|
|
108
|
+
```javascript
|
|
109
|
+
exports.config = {
|
|
110
|
+
i18nIndexing: {
|
|
111
|
+
enable: true,
|
|
112
|
+
outputFolder: 'i18n',
|
|
113
|
+
jsResourcePath: './resources/ApplicationResources.properties',
|
|
114
|
+
propertiesFolderPath: './resources',
|
|
115
|
+
numericMapPath: './numericMap.json',
|
|
116
|
+
singleFile: true,
|
|
117
|
+
singleFileTemplate: '[locale].js',
|
|
118
|
+
jsonpFunc: 'var imAppI18n=',
|
|
119
|
+
htmlTemplateLabel: '{{--user-locale}}',
|
|
120
|
+
localeVarName: 'window.userLangCode',
|
|
121
|
+
includeContentHash: true,
|
|
122
|
+
generateManifest: true,
|
|
123
|
+
manifestPath: 'i18n/imI18nManifest.json'
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
```
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Example configuration for single-file i18n mode
|
|
2
|
+
// When singleFile is true, output will be: i18n/en_US.js, i18n/fr_FR.js, etc.
|
|
3
|
+
|
|
4
|
+
module.exports = {
|
|
5
|
+
i18nIndexing: {
|
|
6
|
+
enable: true,
|
|
7
|
+
|
|
8
|
+
// Output folder for all i18n files
|
|
9
|
+
outputFolder: 'i18n',
|
|
10
|
+
|
|
11
|
+
// Input paths
|
|
12
|
+
jsResourcePath: './resources/ApplicationResources.properties',
|
|
13
|
+
propertiesFolderPath: './resources',
|
|
14
|
+
numericMapPath: './numericMap.json',
|
|
15
|
+
|
|
16
|
+
// Single-file mode configuration
|
|
17
|
+
singleFile: true,
|
|
18
|
+
singleFileTemplate: '[locale].js', // Will create: i18n/en_US.js, i18n/fr_FR.js, etc.
|
|
19
|
+
|
|
20
|
+
// These are ignored in single-file mode but kept for backward compatibility
|
|
21
|
+
numericFilenameTemplate: '[locale]/numeric.i18n.js',
|
|
22
|
+
dynamicFilenameTemplate: '[locale]/dynamic.i18n.js',
|
|
23
|
+
|
|
24
|
+
// Runtime configuration
|
|
25
|
+
jsonpFunc: 'window.loadI18n',
|
|
26
|
+
htmlTemplateLabel: '{{--user-locale}}',
|
|
27
|
+
localeVarName: 'window.userLangCode',
|
|
28
|
+
|
|
29
|
+
// Optimization options
|
|
30
|
+
includeContentHash: true, // Will add hash: i18n/en_US.abc123.js
|
|
31
|
+
generateManifest: true,
|
|
32
|
+
manifestPath: 'i18n/manifest.json', // Custom manifest location
|
|
33
|
+
|
|
34
|
+
// Loader options
|
|
35
|
+
loaderOptions: {
|
|
36
|
+
includePaths: ['src'],
|
|
37
|
+
excludePaths: ['node_modules', 'tests']
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/*
|
|
43
|
+
Output structure with these settings:
|
|
44
|
+
|
|
45
|
+
build/
|
|
46
|
+
├── i18n/
|
|
47
|
+
│ ├── en_US.abc123.js # Combined numeric + dynamic keys with content hash
|
|
48
|
+
│ ├── fr_FR.def456.js
|
|
49
|
+
│ ├── de_DE.ghi789.js
|
|
50
|
+
│ └── manifest.json # Maps original names to hashed versions
|
|
51
|
+
└── index.html # HTML with injected script tag for locale
|
|
52
|
+
|
|
53
|
+
Manifest content example:
|
|
54
|
+
{
|
|
55
|
+
"i18n/en_US.js": "en_US.abc123.js",
|
|
56
|
+
"i18n/fr_FR.js": "fr_FR.def456.js",
|
|
57
|
+
"i18n/de_DE.js": "de_DE.ghi789.js"
|
|
58
|
+
}
|
|
59
|
+
*/
|
|
@@ -4,22 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _fs = require("fs");
|
|
9
|
-
|
|
10
8
|
var _path = require("path");
|
|
11
|
-
|
|
12
9
|
/* eslint-disable global-require */
|
|
10
|
+
|
|
13
11
|
const allConfigs = [];
|
|
14
12
|
(0, _fs.readdirSync)((0, _path.join)(__dirname, 'commands')).forEach(folderName => {
|
|
15
13
|
const modulePath = (0, _path.join)(__dirname, `./commands/${folderName}/config.js`);
|
|
16
|
-
|
|
17
14
|
if ((0, _fs.existsSync)(modulePath)) {
|
|
18
15
|
// eslint-disable-next-line import/no-dynamic-require
|
|
19
16
|
const config = require(modulePath).default;
|
|
20
|
-
|
|
21
17
|
allConfigs.push(config);
|
|
22
18
|
}
|
|
23
19
|
});
|
|
24
|
-
var _default = allConfigs;
|
|
25
|
-
exports.default = _default;
|
|
20
|
+
var _default = exports.default = allConfigs;
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.commandExecutor = commandExecutor;
|
|
7
|
-
|
|
8
7
|
var _logger = require("../../logger");
|
|
9
|
-
|
|
10
8
|
var _webpackBuild = _interopRequireDefault(require("../../shared/bundler/webpack/webpackBuild"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
10
|
function commandExecutor(options) {
|
|
15
11
|
(0, _logger.messageLogger)('Build is running.....');
|
|
16
12
|
(0, _webpackBuild.default)(options);
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.optionsProcessor = optionsProcessor;
|
|
7
|
-
|
|
8
7
|
var _decidePublicPath = require("../../shared/bundler/webpack/common/decidePublicPath");
|
|
9
|
-
|
|
10
8
|
var _modeUtils = require("../../shared/bundler/webpack/common/modeUtils");
|
|
11
|
-
|
|
12
9
|
var _constants = require("../../shared/constants");
|
|
13
|
-
|
|
14
10
|
function optionsProcessor(options) {
|
|
15
11
|
const {
|
|
16
12
|
context,
|
|
@@ -23,7 +19,8 @@ function optionsProcessor(options) {
|
|
|
23
19
|
const serverExtras = (0, _decidePublicPath.modifiedServerOptions)(options);
|
|
24
20
|
const publicPath = noPublicPath ? undefined : (0, _decidePublicPath.decidePublicPath)(serverExtras);
|
|
25
21
|
const contextFolderPath = (0, _constants.joinWithAppPath)(context);
|
|
26
|
-
const defaultAppliedOptions = {
|
|
22
|
+
const defaultAppliedOptions = {
|
|
23
|
+
...options,
|
|
27
24
|
serverExtras,
|
|
28
25
|
// eslint-disable-next-line no-nested-ternary
|
|
29
26
|
mode: mode === null ? 'prod' : mode === 'dev' ? 'dev' : 'prod',
|
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.preProcessor = preProcessor;
|
|
7
|
-
|
|
8
7
|
var _runPreProcess = require("../../shared/pre_process/runPreProcess");
|
|
9
|
-
|
|
10
8
|
function preProcessor(options) {
|
|
11
9
|
(0, _runPreProcess.runPreProcess)(options, 'node');
|
|
12
10
|
}
|
|
@@ -4,22 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.commandExecutor = commandExecutor;
|
|
7
|
-
|
|
8
7
|
var _constants = require("../../shared/constants");
|
|
9
|
-
|
|
10
8
|
var _watchRun = require("../../shared/fileUtils/watchRun");
|
|
11
|
-
|
|
12
9
|
function commandExecutor(options) {
|
|
13
10
|
const {
|
|
14
11
|
extraArgs = []
|
|
15
12
|
} = options;
|
|
16
13
|
const index = extraArgs.indexOf('-w');
|
|
17
14
|
const canWatch = index !== -1;
|
|
18
|
-
|
|
19
15
|
if (canWatch) {
|
|
20
16
|
extraArgs.splice(index, 1);
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
let [src, target] = extraArgs;
|
|
24
19
|
src = (0, _constants.joinWithAppPath)(src || 'src');
|
|
25
20
|
target = (0, _constants.joinWithAppPath)(target || 'es');
|
|
@@ -4,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _default = {
|
|
7
|
+
var _default = exports.default = {
|
|
8
8
|
name: 'buildEs',
|
|
9
9
|
alias: ['build_es', 'build:es'],
|
|
10
10
|
dirname: __dirname
|
|
11
|
-
};
|
|
12
|
-
exports.default = _default;
|
|
11
|
+
};
|
|
@@ -4,22 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.commandExecutor = commandExecutor;
|
|
7
|
-
|
|
8
7
|
var _constants = require("../../shared/constants");
|
|
9
|
-
|
|
10
8
|
var _watchRun = require("../../shared/fileUtils/watchRun");
|
|
11
|
-
|
|
12
9
|
function commandExecutor(options) {
|
|
13
10
|
const {
|
|
14
11
|
extraArgs = []
|
|
15
12
|
} = options;
|
|
16
13
|
const index = extraArgs.indexOf('-w');
|
|
17
14
|
const canWatch = index !== -1;
|
|
18
|
-
|
|
19
15
|
if (canWatch) {
|
|
20
16
|
extraArgs.splice(index, 1);
|
|
21
17
|
}
|
|
22
|
-
|
|
23
18
|
let [src, target] = extraArgs;
|
|
24
19
|
src = (0, _constants.joinWithAppPath)(src || 'src');
|
|
25
20
|
target = (0, _constants.joinWithAppPath)(target || 'lib');
|