@zohodesk/client_build_tool 0.0.11-exp.9 → 0.0.12-exp.1

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.
Files changed (26) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +132 -0
  3. package/README_backup.md +102 -0
  4. package/lib/schemas/defaultConfigValues.js +8 -18
  5. package/lib/schemas/defaultConfigValuesOnly.js +4 -19
  6. package/lib/shared/babel/getBabelPlugin.js +3 -4
  7. package/lib/shared/babel/runBabelForTsFile.js +1 -1
  8. package/lib/shared/bundler/webpack/common/decidePublicPath.js +2 -2
  9. package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +10 -0
  10. package/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +14 -2
  11. package/lib/shared/bundler/webpack/jsLoaders.js +2 -20
  12. package/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +3 -2
  13. package/lib/shared/bundler/webpack/plugins.js +1 -3
  14. package/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +1 -1
  15. package/lib/shared/server/mockApiHandler.js +7 -0
  16. package/lib/shared/server/urlConcat.js +13 -1
  17. package/npm-shrinkwrap.json +354 -38
  18. package/package.json +6 -5
  19. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexHtmlInjectorPlugin.js +0 -49
  20. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js +0 -174
  21. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/utils/i18nDataLoader.js +0 -108
  22. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectAstKeys.js +0 -96
  23. package/lib/shared/bundler/webpack/loaderConfigs/i18nIdReplaceLoaderConfig.js +0 -74
  24. package/lib/shared/bundler/webpack/loaders/i18nIdReplaceLoader.js +0 -105
  25. package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericIndexPlugin.js +0 -79
  26. package/lib/shared/bundler/webpack/utils/propertiesParser.js +0 -103
package/CHANGELOG.md CHANGED
@@ -1,6 +1,36 @@
1
1
  # Changelog and Release Notes
2
2
 
3
+ # v0.0.12 (14-08-2025)
3
4
 
5
+ - Fixed the initial i18n loading issue caused by using the same function in both the i18nRuntimeDealer plugin and decidePublicPath
6
+
7
+ # v0.0.11 (07-08-2025) (had an issue while enable i18n chunk split plugin)
8
+ - remove babel-plugin-module-resolver dependencies
9
+
10
+ **Adjustments:-**
11
+ - Public Folder configuration is separated for development and production
12
+
13
+ **Bug Fix:-**
14
+ - 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`.
15
+ - Removed the babel-plugin-module-resolver dependency to resolve the alias resolution issue in the application.
16
+ - Fixed the issue where a space in the variable name causes it to return an undefined value.
17
+ - Fixed the URL path generation issue that occurred while using context in the development setup.
18
+
19
+
20
+ # v0.0.10 (12-05-2025)
21
+ **Feature:-**
22
+ - `alias` support for `build:es` and `build:lib`
23
+ - Add babel-plugin-module-resolver dependencies
24
+ - Modify getBabelPlugin to include module resolver with aliases
25
+
26
+ **Bug Fix:-**
27
+ - Enhance runBabelForTSFile to handle both .tsx and .ts file extensions
28
+ - Update mockApiHandler to ensure mock function is called correctly
29
+
30
+ **Change:-**
31
+ - Refactor defaultConfigValues.js to include cli options for enableRTLSplit
32
+
33
+ ## v0.0.9
4
34
 
5
35
  **Feature:-**
6
36
  - externals was added to Prevent bundling of certain imported packages and retrieve these external dependencies at runtime.
package/README.md CHANGED
@@ -100,7 +100,139 @@ fixes :-
100
100
 
101
101
  # Changelog and Release Notes
102
102
 
103
+ - remove babel-plugin-module-resolver dependencies
103
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
203
+ # Changelog and Release Notes
204
+
205
+ # v0.0.12 (14-08-2025)
206
+
207
+ - Fixed the initial i18n loading issue caused by using the same function in both the i18nRuntimeDealer plugin and decidePublicPath
208
+
209
+ # v0.0.11 (07-08-2025) (had an issue while enable i18n chunk split plugin)
210
+ - remove babel-plugin-module-resolver dependencies
211
+
212
+ **Adjustments:-**
213
+ - Public Folder configuration is separated for development and production
214
+
215
+ **Bug Fix:-**
216
+ - 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`.
217
+ - Removed the babel-plugin-module-resolver dependency to resolve the alias resolution issue in the application.
218
+ - Fixed the issue where a space in the variable name causes it to return an undefined value.
219
+ - Fixed the URL path generation issue that occurred while using context in the development setup.
220
+
221
+
222
+ # v0.0.10 (12-05-2025)
223
+ **Feature:-**
224
+ - `alias` support for `build:es` and `build:lib`
225
+ - Add babel-plugin-module-resolver dependencies
226
+ - Modify getBabelPlugin to include module resolver with aliases
227
+
228
+ **Bug Fix:-**
229
+ - Enhance runBabelForTSFile to handle both .tsx and .ts file extensions
230
+ - Update mockApiHandler to ensure mock function is called correctly
231
+
232
+ **Change:-**
233
+ - Refactor defaultConfigValues.js to include cli options for enableRTLSplit
234
+
235
+ ## v0.0.9
104
236
 
105
237
  **Feature:-**
106
238
  - externals was added to Prevent bundling of certain imported packages and retrieve these external dependencies at runtime.
package/README_backup.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
@@ -115,7 +115,10 @@ var _default = {
115
115
  // Name Suggestions `customizations` this will be easier then `plugin` to understand for developers
116
116
  plugins: {
117
117
  rtlSplit: {
118
- enableRTLSplit: false,
118
+ enableRTLSplit: {
119
+ value: false,
120
+ cli: 'enable_rtl_split'
121
+ },
119
122
  templateLabel: '{{--dir}}',
120
123
  disableMinifySelector: false,
121
124
  dirVarName: 'document.dir'
@@ -171,25 +174,12 @@ var _default = {
171
174
  localeVarName: 'document.documentElement.lang',
172
175
  jsonpFunc: 'console.log',
173
176
  jsResource: null,
174
- propertiesFolder: null,
175
- useNumericIndexing: false
177
+ propertiesFolder: null
176
178
  },
177
- i18nIndexing: {
178
- enable: false,
179
- jsResourcePath: './deskapp/properties/JSResources.properties',
180
- propertiesFolderPath: './deskapp/properties',
181
- numericMapPath: './deskapp/properties/i18n-numeric-map.json',
182
- numericFilenameTemplate: 'i18n-chunk/[locale]/numeric.i18n.js',
183
- dynamicFilenameTemplate: 'i18n-chunk/[locale]/dynamic.i18n.js',
184
- singleFileTemplate: 'i18n/[locale].js',
185
- jsonpFunc: 'window.loadI18nChunk',
186
- htmlTemplateLabel: '{{--user-locale}}',
187
- localeVarName: 'window.userLangCode',
188
- singleFile: false,
189
- includeContentHash: false,
190
- generateManifest: false
179
+ publicFolders: {
180
+ dev: ['...'],
181
+ prod: ['...']
191
182
  },
192
- publicFolders: ['...'],
193
183
  app: {
194
184
  entryFile: {
195
185
  value: 'src/index.js',
@@ -94,27 +94,12 @@ var _default = {
94
94
  localeVarName: 'document.documentElement.lang',
95
95
  jsonpFunc: 'console.log',
96
96
  jsResource: null,
97
- propertiesFolder: null,
98
- useNumericIndexing: false
97
+ propertiesFolder: null
99
98
  },
100
- i18nIndexing: {
101
- enable: false,
102
- jsResourcePath: './deskapp/properties/JSResources.properties',
103
- propertiesFolderPath: './deskapp/properties',
104
- numericMapPath: './deskapp/properties/i18n-numeric-map.json',
105
- numericFilenameTemplate: 'i18n-chunk/[locale]/numeric.i18n.js',
106
- dynamicFilenameTemplate: 'i18n-chunk/[locale]/dynamic.i18n.js',
107
- jsonpFunc: 'window.loadI18nChunk',
108
- htmlTemplateLabel: '{{--user-locale}}',
109
- localeVarName: 'window.userLangCode',
110
- singleFile: false,
111
- includeContentHash: false,
112
- generateManifest: false
99
+ publicFolders: {
100
+ dev: ['...'],
101
+ prod: ['...']
113
102
  },
114
- publicFolders: ['...', {
115
- source: './deskapp/tp/',
116
- target: './tp/'
117
- }],
118
103
  app: {
119
104
  entryFile: 'src/index.js',
120
105
  tpFolder: null,
@@ -19,7 +19,8 @@ const babelPluginOrder = ['removeAttribute', 'removePropTypes', 'devConsoleExclu
19
19
  function getBabelPlugin(options) {
20
20
  const {
21
21
  mode
22
- } = options;
22
+ } = options; // let customPlugins = [];
23
+
23
24
  let customPlugins = [];
24
25
  const {
25
26
  babelCustomizations
@@ -32,6 +33,4 @@ function getBabelPlugin(options) {
32
33
  }
33
34
 
34
35
  return customPlugins.filter(Boolean);
35
- }
36
-
37
- ;
36
+ }
@@ -25,6 +25,6 @@ function runBabelForTSFile({
25
25
  // const jsSourceCode = readFileSync(filename).toString();
26
26
  const babelConfig = (0, _babelWebConfig.babelWebConfig)(options, mode);
27
27
  const result = (0, _core.transformFileSync)(filename, babelConfig);
28
- (0, _copyFile.writeFile)(outputFile.replace('.tsx', '.js'), result.code);
28
+ (0, _copyFile.writeFile)(outputFile.replace('.tsx', '.js').replace('.ts', '.js'), result.code);
29
29
  }
30
30
  }
@@ -50,8 +50,8 @@ function modifiedServerOptions(options) {
50
50
  contextURL,
51
51
  httpsPort: port,
52
52
  httpPort,
53
- httpsUrl: (0, _urlConcat.urlConcat)(httpsUrl, contextURL),
54
- httpUrl: (0, _urlConcat.urlConcat)(httpUrl, contextURL),
53
+ httpsUrl: (0, _urlConcat.serverPathConcat)(httpsUrl, contextURL),
54
+ httpUrl: (0, _urlConcat.serverPathConcat)(httpUrl, contextURL),
55
55
  isHttps: !!httpsOptions
56
56
  };
57
57
  }
@@ -30,6 +30,16 @@ class BundleIntegrityReport {
30
30
 
31
31
  apply(compiler) {
32
32
  compiler.hooks.done.tapAsync(pluginName, (stats, callback) => {
33
+ if (stats.hasErrors()) {
34
+ console.error(stats.toString({
35
+ all: false,
36
+ errors: true,
37
+ errorDetails: true,
38
+ colors: true
39
+ }));
40
+ return callback(new Error('Build failed due to compilation errors.'));
41
+ }
42
+
33
43
  const statsJson = (0, _objectManipulation.removeKeysFromObject)(stats.toJson(this.statsOptions), this.excludeKeysInStat);
34
44
  this.emitStats(statsJson).on('end', () => {
35
45
  callback();
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.SourceMapPlugin = void 0;
7
7
 
8
- var _webpack = require("webpack");
8
+ var _webpack2 = require("webpack");
9
9
 
10
10
  /* eslint-disable class-methods-use-this */
11
11
  function checkSmapFilePattern(assetName) {
@@ -31,7 +31,7 @@ class SourceMapPlugin {
31
31
  compiler.hooks.thisCompilation.tap(pluginName, compilation => {
32
32
  compilation.hooks.processAssets.tap({
33
33
  name: pluginName,
34
- stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
34
+ stage: _webpack2.Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL
35
35
  }, assets => {
36
36
  Object.keys(assets).forEach(assetName => {
37
37
  const assetCode = assets[assetName].source();
@@ -44,6 +44,18 @@ class SourceMapPlugin {
44
44
  }
45
45
  }
46
46
  });
47
+ });
48
+ compilation.hooks.processAssets.tap({
49
+ name: pluginName,
50
+ stage: _webpack.Compilation.PROCESS_ASSETS_STAGE_REPORT
51
+ }, assets => {
52
+ Object.keys(assets).forEach(assetName => {
53
+ const assetCode = assets[assetName].source();
54
+
55
+ if (/\.map$/.test(assetName)) {
56
+ compilation.emitAsset(assetName.split('smap/')[1], new RawSource(assetCode));
57
+ }
58
+ });
47
59
  }); // if contenthash enabled we need to add this to include the runtime files
48
60
  // compilation.hooks.processAssets.tap(
49
61
  // {
@@ -7,29 +7,11 @@ exports.jsLoaders = jsLoaders;
7
7
 
8
8
  var _babelLoaderConfig = require("./loaderConfigs/babelLoaderConfig");
9
9
 
10
- const {
11
- i18nIdReplaceLoaderConfig
12
- } = require('./loaderConfigs/i18nIdReplaceLoaderConfig');
13
-
14
10
  function jsLoaders(options) {
15
- const useLoaders = [];
16
- useLoaders.push((0, _babelLoaderConfig.babelLoaderConfig)(options));
17
- const shouldUseNumericIndexing = options.i18nIndexing && options.i18nIndexing.enable || options.i18nChunkSplit && options.i18nChunkSplit.chunkSplitEnable && options.i18nChunkSplit.useNumericIndexing;
18
-
19
- if (shouldUseNumericIndexing) {
20
- try {
21
- const loaderConfig = i18nIdReplaceLoaderConfig(options, options.context);
22
-
23
- if (loaderConfig) {
24
- useLoaders.push(loaderConfig);
25
- }
26
- } catch (err) {// Silently skip if configuration fails
27
- }
28
- }
29
-
30
11
  return [{
31
12
  test: /\.js$/,
32
13
  exclude: /node_modules/,
33
- use: useLoaders
14
+ use: [(0, _babelLoaderConfig.babelLoaderConfig)(options)] // include: path.join(appPath, folder)
15
+
34
16
  }];
35
17
  }
@@ -43,9 +43,10 @@ function folderPatterns(publicFolders) {
43
43
 
44
44
  function configCopyPublicFolders(options) {
45
45
  let {
46
- publicFolders
46
+ publicFolders,
47
+ mode = 'dev'
47
48
  } = options;
48
- publicFolders = (0, _updateArrayWithDefault.updateArrayWithDefault)(publicFolders, defaultPublicFolders);
49
+ publicFolders = (0, _updateArrayWithDefault.updateArrayWithDefault)(publicFolders[mode], defaultPublicFolders);
49
50
 
50
51
  if (publicFolders.length === 0) {
51
52
  return null;
@@ -49,12 +49,10 @@ var _configRuntimeResourceCleanup = require("./pluginConfigs/configRuntimeResour
49
49
 
50
50
  var _configCustomScriptLoadingStrategyPlugin = require("./pluginConfigs/configCustomScriptLoadingStrategyPlugin");
51
51
 
52
- var _configI18nNumericIndexPlugin = require("./pluginConfigs/configI18nNumericIndexPlugin");
53
-
54
52
  // import { IgnorePlugin } from 'webpack';
55
53
  function plugins(options) {
56
54
  const {
57
55
  webpackPlugins
58
56
  } = options;
59
- return [(0, _configEnvVariables.configEnvVariables)(options), (0, _configCustomAttributesPlugin.configCustomAttributesPlugin)(options), (0, _configTPHashMappingPlugin.configTPHashMappingPlugin)(options), (0, _configCopyPublicFolders.configCopyPublicFolders)(options), (0, _configIgnorePlugin.configIgnorePlugin)(options), (0, _configMiniCSSExtractPlugin.configMiniCSSExtractPlugin)(options), (0, _configSelectorWeightPlugin.configSelectorWeightPlugin)(options), (0, _configVariableConversionPlugin.configVariableConversionPlugin)(options), (0, _configI18nSplitPlugin.configI18nSplitPlugin)(options), (0, _configRtlCssPlugin.configRtlCssPlugin)(options), (0, _configHtmlWebpackPlugin.configHtmlWebpackPlugin)(options), ...((0, _configI18nNumericIndexPlugin.configI18nNumericIndexPlugin)(options) || []), (0, _configCustomScriptLoadingStrategyPlugin.configCustomScriptLoadingStrategyPlugin)(options), (0, _configCdnChangePlugin.configCdnChangePlugin)(options), (0, _configServiceWorkerPlugin.configServiceWorkerPlugin)(options), (0, _configEFCTemplatePlugin.configEFCTemplatePlugin)(options), (0, _configResourceHintsPlugin.configResourceHintsPlugin)(options), (0, _configBundleAnalyzer.configBundleAnalyzer)(options), (0, _configManifestJsonPlugin.configManifestJsonPlugin)(options), (0, _configSourceMapPlugin.configSourceMapPlugin)(options), (0, _configProgressPlugin.configProgressPlugin)(options), (0, _configBundleIntegrityReport.configBundleIntegrityReport)(options), (0, _configRuntimeResourceCleanup.configRuntimeResourceCleanup)(options), ...webpackPlugins].filter(Boolean);
57
+ return [(0, _configEnvVariables.configEnvVariables)(options), (0, _configCustomAttributesPlugin.configCustomAttributesPlugin)(options), (0, _configTPHashMappingPlugin.configTPHashMappingPlugin)(options), (0, _configCopyPublicFolders.configCopyPublicFolders)(options), (0, _configIgnorePlugin.configIgnorePlugin)(options), (0, _configMiniCSSExtractPlugin.configMiniCSSExtractPlugin)(options), (0, _configSelectorWeightPlugin.configSelectorWeightPlugin)(options), (0, _configVariableConversionPlugin.configVariableConversionPlugin)(options), (0, _configI18nSplitPlugin.configI18nSplitPlugin)(options), (0, _configRtlCssPlugin.configRtlCssPlugin)(options), (0, _configHtmlWebpackPlugin.configHtmlWebpackPlugin)(options), (0, _configCustomScriptLoadingStrategyPlugin.configCustomScriptLoadingStrategyPlugin)(options), (0, _configCdnChangePlugin.configCdnChangePlugin)(options), (0, _configServiceWorkerPlugin.configServiceWorkerPlugin)(options), (0, _configEFCTemplatePlugin.configEFCTemplatePlugin)(options), (0, _configResourceHintsPlugin.configResourceHintsPlugin)(options), (0, _configBundleAnalyzer.configBundleAnalyzer)(options), (0, _configManifestJsonPlugin.configManifestJsonPlugin)(options), (0, _configSourceMapPlugin.configSourceMapPlugin)(options), (0, _configProgressPlugin.configProgressPlugin)(options), (0, _configBundleIntegrityReport.configBundleIntegrityReport)(options), (0, _configRuntimeResourceCleanup.configRuntimeResourceCleanup)(options), ...webpackPlugins].filter(Boolean);
60
58
  }
@@ -259,7 +259,7 @@ var _default = ({
259
259
  if (range) {
260
260
  // console.log('multiple :', decl.value)
261
261
  let newVal = '';
262
- decl.value.split(' ').forEach(singleVal => {
262
+ decl.value.split(' ').filter(Boolean).forEach(singleVal => {
263
263
  newVal += `${singleConvertor(singleVal, settings.replacements.px, {
264
264
  decl,
265
265
  filename,
@@ -44,6 +44,13 @@ function handleMockApi(mockEntryFile, app) {
44
44
  const entryFilePath = (0, _constants.joinWithAppPath)(mockEntryFile); // eslint-disable-next-line no-use-before-define
45
45
 
46
46
  const mockFunc = safeRequire(entryFilePath);
47
+
48
+ if (typeof mockFunc === 'function') {
49
+ // eslint-disable-next-line no-use-before-define
50
+ mockFunc(app);
51
+ return;
52
+ }
53
+
47
54
  mockFunc?.mockApi?.(app);
48
55
  } // function handleMockApi(params) {
49
56
  // }
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.serverPathConcat = serverPathConcat;
6
7
  exports.urlConcat = urlConcat;
7
8
 
8
9
  /* eslint-disable no-use-before-define */
@@ -12,6 +13,17 @@ exports.urlConcat = urlConcat;
12
13
  * @param {String} url
13
14
  * @param {String} path
14
15
  */
16
+ function serverPathConcat(url, path) {
17
+ const slashRemovedUrl = removeLastSlash(url);
18
+ const slashRemovedPath = removeFrontSlash(path);
19
+
20
+ if (slashRemovedUrl === '') {
21
+ return `${path}/`;
22
+ }
23
+
24
+ return `${[slashRemovedUrl, slashRemovedPath].filter(a => a).join('/')}/`;
25
+ }
26
+
15
27
  function urlConcat(url, path) {
16
28
  const slashRemovedUrl = removeLastSlash(url);
17
29
  const slashRemovedPath = removeFrontSlash(path);
@@ -20,7 +32,7 @@ function urlConcat(url, path) {
20
32
  return path;
21
33
  }
22
34
 
23
- return `${slashRemovedUrl}/${slashRemovedPath}/`;
35
+ return `${slashRemovedUrl}/${slashRemovedPath}`;
24
36
  }
25
37
 
26
38
  function removeLastSlash(url) {