@zohodesk/react-cli 1.1.19-exp.15 → 1.1.19-exp.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -37,6 +37,8 @@ var _configHtmlWebpackPlugins = require("./configHtmlWebpackPlugins");
37
37
 
38
38
  var _EfcResourceCleanupPlugin = _interopRequireDefault(require("../plugins/EfcResourceCleanupPlugin"));
39
39
 
40
+ var _EventsHandlingPlugin = require("../plugins/EventsHandlingPlugin");
41
+
40
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41
43
 
42
44
  // import { windowsModification } from '../loaderUtils/windowsModification';
@@ -191,11 +193,16 @@ const getDevPlugins = (options, publicPath) => {
191
193
  i18nManifestFileName,
192
194
  mainChunkName: 'main'
193
195
  }));
194
- instrumentScript && pluginsArr.push(new _plugins.ScriptInstrumentPlugin());
195
- customAttributes.enable && pluginsArr.push(new _CustomAttributePlugin.CustomAttributePlugin(customAttributes));
196
- customAttributes.enable && pluginsArr.push(new _EfcResourceCleanupPlugin.default(Object.assign({}, customAttributes, {
197
- globalCacheObj: context
198
- })));
196
+ instrumentScript && pluginsArr.push(new _plugins.ScriptInstrumentPlugin()); // customAttributes.enable &&
197
+ // console.log('hello ')
198
+ // pluginsArr.push(new CustomAttributePlugin(customAttributes));
199
+ // customAttributes.enable &&
200
+ // pluginsArr.push(
201
+ // new EfcResouc eCleanupPlugin(
202
+ // Object.assign({}, customAttributes, { globalCacheObj: context })
203
+ // )
204
+ // );
205
+
199
206
  hasShadowDOM && pluginsArr.push(new _plugins.ShadowDOMSupportPlugin());
200
207
 
201
208
  if (devCssFileBountry) {
@@ -217,12 +224,13 @@ const getDevPlugins = (options, publicPath) => {
217
224
  exclude: exclude.selectorWeight,
218
225
  patterns
219
226
  }));
220
- } // if (pluginObject.minifier) {
227
+ }
228
+
229
+ pluginsArr.push(new _EventsHandlingPlugin.EventsHandlingPlugin()); // if (pluginObject.minifier) {
221
230
  // // console.log('minifier active');
222
231
  // pluginsArr.push(new MinifierPlugin());
223
232
  // }
224
233
 
225
-
226
234
  return pluginsArr.filter(Boolean);
227
235
  };
228
236
 
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EventsHandlingPlugin = void 0;
7
+
8
+ /* eslint-disable no-use-before-define */
9
+ class EventsHandlingPlugin {
10
+ constructor(options) {}
11
+
12
+ apply(compiler) {
13
+ console.log("hi"); // NOTE: we not using this, Reason currently this option is only need for EFC,
14
+ // So it do not needed.
15
+
16
+ compiler.hooks.thisCompilation.tap({
17
+ name: 'CustomAttributePlugin',
18
+ stage: 1,
19
+ fn: compilation => {
20
+ compilation.mainTemplate.hooks.requireEnsure.tap('CustomAttributePlugin', source => {
21
+ // const str = attributeSetTemplate(cssAttributes, 'linkTag');
22
+ const replacesourcedStr = source.replace('linkTag.onerror = function(event) {', 'linkTag.onerror = function(event) { linkTag.onerror = linkTag.onload = null');
23
+ const re = replacesourcedStr.replace('linkTag.onload = resolve', `linkTag.onload = () => {
24
+ resolve();
25
+ linkTag.onerror = linkTag.onload = null
26
+ };`); // console.log({ s: source, r: replacedStr });
27
+
28
+ return re;
29
+ });
30
+ }
31
+ });
32
+ }
33
+
34
+ }
35
+
36
+ exports.EventsHandlingPlugin = EventsHandlingPlugin;
@@ -228,11 +228,12 @@ class I18nDownlodLogic {
228
228
  if(dataSrc === srcPath || dataSrc === fullsrcPath){ return resolve();}
229
229
  }
230
230
  var scriptTag = document.createElement("script");
231
- scriptTag.onload = () => {
231
+ scriptTag.onload = () => {
232
232
  resolve();
233
233
  scriptTag.onerror = scriptTag.onload = null;
234
- };
234
+ };
235
235
  scriptTag.onerror = function(event) {
236
+ scriptTag.onerror = scriptTag.onload = null;
236
237
  var request = event && event.target && event.target.src || fullsrcPath;
237
238
  var err = new Error("Loading I18N chunk " + chunkId + " failed.\\n(" + request + ")");
238
239
  err.code = "I18N_CHUNK_LOAD_FAILED";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/react-cli",
3
- "version": "1.1.19-exp.15",
3
+ "version": "1.1.19-exp.17",
4
4
  "description": "A CLI tool for build modern web application and libraries",
5
5
  "scripts": {
6
6
  "init": "node ./lib/utils/init.js",