@arkxio/ark-dev-utils 0.1.14 → 0.1.15

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/dist/index.js CHANGED
@@ -1259,24 +1259,23 @@
1259
1259
  // content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
1260
1260
  // // }
1261
1261
 
1262
+ let findUnpkgModel = false;
1262
1263
  // 整串替换:\"https://unpkg.com\" 或 "https://unpkg.com" → window.ArkConfig.cdnHost
1263
1264
  const newContent1 = content.replace(/\\?"https:\/\/unpkg\.com\\?"/g, 'window.ArkConfig.cdnHost');
1264
1265
  if (newContent1 !== content) {
1265
-
1266
- compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent1));
1267
- return;
1266
+ findUnpkgModel = true;
1268
1267
  }
1269
1268
 
1270
1269
  // 部分替换:"https://unpkg.com → window.ArkConfig.cdnHost + "
1271
- const newContent2 = content.replace(/(?<!\\)"(https:\/\/unpkg\.com)/g, `window.ArkConfig.cdnHost + "`);
1272
- if (newContent2 !== content) {
1273
- compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent2));
1270
+ const newContent2 = newContent1.replace(/(?<!\\)"(https:\/\/unpkg\.com)/g, `window.ArkConfig.cdnHost + "`);
1271
+ if (newContent2 !== newContent1) {
1272
+ findUnpkgModel = true;
1274
1273
  }
1275
1274
 
1276
- // if (findUnpkgModel) {
1277
- // 更新资源
1278
- // compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
1279
- // }
1275
+ if (findUnpkgModel) {
1276
+ // 更新资源
1277
+ compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent2));
1278
+ }
1280
1279
  });
1281
1280
  }
1282
1281
  );
package/dist/index.min.js CHANGED
@@ -1259,24 +1259,23 @@
1259
1259
  // content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
1260
1260
  // // }
1261
1261
 
1262
+ let findUnpkgModel = false;
1262
1263
  // 整串替换:\"https://unpkg.com\" 或 "https://unpkg.com" → window.ArkConfig.cdnHost
1263
1264
  const newContent1 = content.replace(/\\?"https:\/\/unpkg\.com\\?"/g, 'window.ArkConfig.cdnHost');
1264
1265
  if (newContent1 !== content) {
1265
-
1266
- compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent1));
1267
- return;
1266
+ findUnpkgModel = true;
1268
1267
  }
1269
1268
 
1270
1269
  // 部分替换:"https://unpkg.com → window.ArkConfig.cdnHost + "
1271
- const newContent2 = content.replace(/(?<!\\)"(https:\/\/unpkg\.com)/g, `window.ArkConfig.cdnHost + "`);
1272
- if (newContent2 !== content) {
1273
- compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent2));
1270
+ const newContent2 = newContent1.replace(/(?<!\\)"(https:\/\/unpkg\.com)/g, `window.ArkConfig.cdnHost + "`);
1271
+ if (newContent2 !== newContent1) {
1272
+ findUnpkgModel = true;
1274
1273
  }
1275
1274
 
1276
- // if (findUnpkgModel) {
1277
- // 更新资源
1278
- // compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
1279
- // }
1275
+ if (findUnpkgModel) {
1276
+ // 更新资源
1277
+ compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent2));
1278
+ }
1280
1279
  });
1281
1280
  }
1282
1281
  );
package/lib/index.js CHANGED
@@ -1264,24 +1264,23 @@ class ArkWebpackPlugin {
1264
1264
  // content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
1265
1265
  // // }
1266
1266
 
1267
+ let findUnpkgModel = false;
1267
1268
  // 整串替换:\"https://unpkg.com\" 或 "https://unpkg.com" → window.ArkConfig.cdnHost
1268
1269
  const newContent1 = content.replace(/\\?"https:\/\/unpkg\.com\\?"/g, 'window.ArkConfig.cdnHost');
1269
1270
  if (newContent1 !== content) {
1270
-
1271
- compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent1));
1272
- return;
1271
+ findUnpkgModel = true;
1273
1272
  }
1274
1273
 
1275
1274
  // 部分替换:"https://unpkg.com → window.ArkConfig.cdnHost + "
1276
- const newContent2 = content.replace(/(?<!\\)"(https:\/\/unpkg\.com)/g, `window.ArkConfig.cdnHost + "`);
1277
- if (newContent2 !== content) {
1278
- compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent2));
1275
+ const newContent2 = newContent1.replace(/(?<!\\)"(https:\/\/unpkg\.com)/g, `window.ArkConfig.cdnHost + "`);
1276
+ if (newContent2 !== newContent1) {
1277
+ findUnpkgModel = true;
1279
1278
  }
1280
1279
 
1281
- // if (findUnpkgModel) {
1282
- // 更新资源
1283
- // compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
1284
- // }
1280
+ if (findUnpkgModel) {
1281
+ // 更新资源
1282
+ compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent2));
1283
+ }
1285
1284
  });
1286
1285
  }
1287
1286
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkxio/ark-dev-utils",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "ark dev utils",
5
5
  "repository": {
6
6
  "type": "git",
@@ -84,24 +84,23 @@ export default class ArkWebpackPlugin {
84
84
  // content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
85
85
  // // }
86
86
 
87
+ let findUnpkgModel = false;
87
88
  // 整串替换:\"https://unpkg.com\" 或 "https://unpkg.com" → window.ArkConfig.cdnHost
88
89
  const newContent1 = content.replace(/\\?"https:\/\/unpkg\.com\\?"/g, 'window.ArkConfig.cdnHost');
89
90
  if (newContent1 !== content) {
90
-
91
- compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent1));
92
- return;
91
+ findUnpkgModel = true;
93
92
  }
94
93
 
95
94
  // 部分替换:"https://unpkg.com → window.ArkConfig.cdnHost + "
96
- const newContent2 = content.replace(/(?<!\\)"(https:\/\/unpkg\.com)/g, `window.ArkConfig.cdnHost + "`);
97
- if (newContent2 !== content) {
98
- compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent2));
95
+ const newContent2 = newContent1.replace(/(?<!\\)"(https:\/\/unpkg\.com)/g, `window.ArkConfig.cdnHost + "`);
96
+ if (newContent2 !== newContent1) {
97
+ findUnpkgModel = true;
99
98
  }
100
99
 
101
- // if (findUnpkgModel) {
102
- // 更新资源
103
- // compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
104
- // }
100
+ if (findUnpkgModel) {
101
+ // 更新资源
102
+ compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(newContent2));
103
+ }
105
104
  });
106
105
  }
107
106
  );