@zohodesk/react-cli 1.1.24 → 1.1.25-exp.2

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -44,6 +44,10 @@ Now to run app
44
44
 
45
45
  # Change Logs
46
46
 
47
+ # 1.1.25 (12-08-2024)
48
+
49
+ - mp3 files support added
50
+
47
51
  # 1.1.24 (29-06-2024)
48
52
 
49
53
  - Worker loading logic fixes.
@@ -43,7 +43,8 @@ const {
43
43
  crossorigin,
44
44
  postCssPluginOrder,
45
45
  externals,
46
- enableMjsLoader
46
+ enableMjsLoader,
47
+ displayClassName
47
48
  },
48
49
  enableTypeScript
49
50
  } = options;
@@ -120,7 +121,8 @@ module.exports = {
120
121
  classNameBlob: '[local]',
121
122
  cssUniqueness: false,
122
123
  selectorReplace: null,
123
- postCssPluginOrder
124
+ postCssPluginOrder,
125
+ displayClassName
124
126
  })
125
127
  } : null, {
126
128
  test: seperateCssModules ? /\.module\.css$/ : /(\.module)?\.css$/,
@@ -137,7 +139,8 @@ module.exports = {
137
139
  selectorReplace,
138
140
  cssHashSelectors,
139
141
  classNamePrefix,
140
- postCssPluginOrder
142
+ postCssPluginOrder,
143
+ displayClassName
141
144
  })
142
145
  }, (0, _configsAssetsLoaders.configImageLoader)(nameTemplate), (0, _configsAssetsLoaders.configFontLoader)(nameTemplate), (0, _configsAssetsLoaders.configSVGLoader)(nameTemplate), (0, _configsAssetsLoaders.configVideoLoader)(nameTemplate), (0, _configsAssetsLoaders.configAudioLoader)(nameTemplate), {
143
146
  test: /\.tmpl$/,
@@ -36,6 +36,7 @@ const {
36
36
  cssVariableReplacementConfig,
37
37
  selectorWeightConfig,
38
38
  cssUniqueness,
39
+ displayClassName,
39
40
  customClassNamePrefix,
40
41
  server: {
41
42
  mode
@@ -173,7 +174,8 @@ module.exports = {
173
174
  cssUniqueness: false,
174
175
  customClassNamePrefix,
175
176
  selectorReplace: null,
176
- postCssPluginOrder
177
+ postCssPluginOrder,
178
+ displayClassName
177
179
  })
178
180
  } : null, {
179
181
  test: seperateCssModules ? /\.module\.css$/ : /\.css$/,
@@ -190,7 +192,8 @@ module.exports = {
190
192
  selectorReplace,
191
193
  cssHashSelectors,
192
194
  classNamePrefix,
193
- postCssPluginOrder
195
+ postCssPluginOrder,
196
+ displayClassName
194
197
  })
195
198
  }, {
196
199
  test: /\.jpe?g$|\.gif$|\.png$/,
@@ -223,7 +226,7 @@ module.exports = {
223
226
  }
224
227
  }]
225
228
  }, {
226
- test: /\.ogg$/,
229
+ test: /\.ogg|\.mp3$/,
227
230
  use: [{
228
231
  loader: 'file-loader',
229
232
  options: {
@@ -19,7 +19,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
19
19
  const ImageExtRegex = /\.jpe?g$|\.gif$|\.png|\.webp$/;
20
20
  const FontExtRegex = /\.woff2|\.woff$|\.ttf$|\.eot$/;
21
21
  const SVGExtRegex = /\.svg$/;
22
- const AudioExtRegex = /\.ogg$/;
22
+ const AudioExtRegex = /\.ogg|\.mp3$/;
23
23
  const VidioExtRegex = /\.mp4|\.webm$/;
24
24
 
25
25
  function createLoaderOptionQueryString(loaderName, nameTemplate, limit = 1000) {
@@ -45,7 +45,8 @@ const getCSSLoaders = optionsObj => {
45
45
  cssHashSelectors,
46
46
  classNamePrefix,
47
47
  postCssPluginOrder,
48
- customClassNamePrefix
48
+ customClassNamePrefix,
49
+ displayClassName
49
50
  } = optionsObj;
50
51
  const {
51
52
  devCssFileBountry
@@ -66,7 +67,7 @@ const getCSSLoaders = optionsObj => {
66
67
  if (classNameBlob) {
67
68
  cssLoaderOptions.modules.localIdentName = classNameBlob;
68
69
  } else {
69
- cssLoaderOptions.modules.getLocalIdent = (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix, customClassNamePrefix, patterns);
70
+ cssLoaderOptions.modules.getLocalIdent = (0, _cssClassNameGenerate.default)(cssUniqueness, cssHashSelectors, classNamePrefix, customClassNamePrefix, patterns, displayClassName);
70
71
  }
71
72
 
72
73
  const pluginOrder = calculatePostCssPluginOrder(postCssPluginOrder, Object.keys(plugins).filter(x => plugins[x] === true)); // console.log('selector weight config : ', selectorWeightConfig);
@@ -33,14 +33,13 @@ var _VariableConversionCollector = _interopRequireDefault(require("../plugins/Va
33
33
 
34
34
  var _SelectorPlugin = _interopRequireDefault(require("../plugins/SelectorPlugin"));
35
35
 
36
- var _configHtmlWebpackPlugins = require("./configHtmlWebpackPlugins");
37
-
38
36
  var _EfcResourceCleanupPlugin = _interopRequireDefault(require("../plugins/EfcResourceCleanupPlugin"));
39
37
 
40
38
  var _EventsHandlingPlugin = require("../plugins/EventsHandlingPlugin");
41
39
 
42
40
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43
41
 
42
+ // import { configHtmlWebpackPlugins } from './configHtmlWebpackPlugins';
44
43
  // import { windowsModification } from '../loaderUtils/windowsModification';
45
44
  const getDevPlugins = (options, publicPath) => {
46
45
  const {
@@ -162,16 +161,15 @@ const getDevPlugins = (options, publicPath) => {
162
161
  pluginsArr.push(new _lodashWebpackPlugin.default({
163
162
  collections: true,
164
163
  shorthands: true
165
- }));
166
- (0, _configHtmlWebpackPlugins.configHtmlWebpackPlugins)(pluginsArr, {
167
- enableChunkHash: false,
168
- folder,
169
- minify: false,
170
- inject,
171
- crossorigin,
172
- hasEFC,
173
- customScriptLoadingStrategey
174
- });
164
+ })); // configHtmlWebpackPlugins(pluginsArr, {
165
+ // enableChunkHash: false,
166
+ // folder,
167
+ // minify: false,
168
+ // inject,
169
+ // crossorigin,
170
+ // hasEFC,
171
+ // customScriptLoadingStrategey,
172
+ // });
175
173
 
176
174
  if (hasEFC) {
177
175
  pluginsArr.push(new _plugins.EFCPlugin({
@@ -35,14 +35,13 @@ var _CustomAttributePlugin = require("../plugins/CustomAttributePlugin");
35
35
 
36
36
  var _RtlCssPlugin = require("../plugins/RtlSplitPlugin/RtlCssPlugin");
37
37
 
38
- var _configHtmlWebpackPlugins = require("./configHtmlWebpackPlugins");
39
-
40
38
  var _StatsPlugin = _interopRequireDefault(require("../plugins/StatsPlugin"));
41
39
 
42
40
  var _EfcResourceCleanupPlugin = _interopRequireDefault(require("../plugins/EfcResourceCleanupPlugin"));
43
41
 
44
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
45
43
 
44
+ // import { configHtmlWebpackPlugins } from './configHtmlWebpackPlugins';
46
45
  // eslint-disable-next-line no-unused-vars
47
46
  const getProdPlugins = (options, publicPath = '') => {
48
47
  let {
@@ -173,16 +172,15 @@ const getProdPlugins = (options, publicPath = '') => {
173
172
  from: `${_path.default.join(process.cwd(), context, tpFolder)}/`,
174
173
  to: `./${tpFolder}/`,
175
174
  toType: 'dir'
176
- }]));
177
- (0, _configHtmlWebpackPlugins.configHtmlWebpackPlugins)(pluginsArr, {
178
- enableChunkHash,
179
- folder,
180
- inject,
181
- minify: minifyHtmlOptions,
182
- customScriptLoadingStrategey,
183
- crossorigin,
184
- hasEFC
185
- });
175
+ }])); // configHtmlWebpackPlugins(pluginsArr, {
176
+ // enableChunkHash,
177
+ // folder,
178
+ // inject,
179
+ // minify: minifyHtmlOptions,
180
+ // customScriptLoadingStrategey,
181
+ // crossorigin,
182
+ // hasEFC
183
+ // });
186
184
 
187
185
  if (hasEFC) {
188
186
  pluginsArr.push(new _plugins.EFCPlugin({
@@ -126,6 +126,10 @@ var _default = {
126
126
  cssDirStatement: null
127
127
  },
128
128
  app: {
129
+ displayClassName: {
130
+ value: false,
131
+ cli: 'display_class_name'
132
+ },
129
133
  moduleResolvePath: {
130
134
  value: '@zohodesk/client_packages_group',
131
135
  cli: 'module_resolve_path'
@@ -62,7 +62,7 @@ function patternBasedClass({
62
62
  var _default = (unique = true, {
63
63
  filenames,
64
64
  packages
65
- }, classNamePrefix, customClassNamePrefix, patterns) => (context, localIdentName, localName) => {
65
+ }, classNamePrefix, customClassNamePrefix, patterns, displayClassName) => (context, localIdentName, localName) => {
66
66
  // console.log(patterns, context.resourcePath);
67
67
  // NOTE: in build machine we use date as folder path.
68
68
  // So every time we create new build there is path will alway different
@@ -92,6 +92,11 @@ var _default = (unique = true, {
92
92
  */
93
93
 
94
94
 
95
+ if (displayClassName) {
96
+ return `${fileNameWithoutExt}_${localName}`;
97
+ } // return cleanFileName
98
+
99
+
95
100
  if (context.resourcePath.endsWith('.plain.css')) {
96
101
  return localName;
97
102
  }
@@ -45,5 +45,5 @@ function isVideoFileExt(ext) {
45
45
  }
46
46
 
47
47
  function isAudioFileExt(ext) {
48
- return ext === '.ogg';
48
+ return ext === '.ogg' || ext === '.mp3';
49
49
  }