@arkxio/ark-dev-utils 0.1.11 → 0.1.12
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 +6 -29
- package/dist/index.min.js +6 -29
- package/lib/index.js +6 -29
- package/package.json +1 -1
- package/src/ArkWebpackPlugin.js +8 -8
package/dist/index.js
CHANGED
|
@@ -1228,45 +1228,22 @@
|
|
|
1228
1228
|
}
|
|
1229
1229
|
|
|
1230
1230
|
let content = source.source().toString();
|
|
1231
|
-
|
|
1232
|
-
// 替换逻辑
|
|
1233
|
-
// /(__webpack_require__\.l)\(url,/g)
|
|
1234
|
-
// const webpackRequireLPattern = /(__webpack_require__\.l)\(url,/g;
|
|
1235
|
-
// if (webpackRequireLPattern.test(content)) {
|
|
1236
|
-
// verbose('检测到 __webpack_require__.l 模式');
|
|
1237
|
-
// content = content.replace(
|
|
1238
|
-
// webpackRequireLPattern,
|
|
1239
|
-
// `(function(url, done, key, chunkId) {
|
|
1240
|
-
// if (typeof window.ArkConfig !== 'undefined' && window.ArkConfig.cdnHost) {
|
|
1241
|
-
// if (!url.startsWith(window.ArkConfig.cdnHost) && url.startsWith('https://unpkg.com')) {
|
|
1242
|
-
// url = window.ArkConfig.cdnHost + url.slice('https://unpkg.com'.length);
|
|
1243
|
-
// }
|
|
1244
|
-
// }
|
|
1245
|
-
// return $1(url, done, key, chunkId);
|
|
1246
|
-
// })(url,`
|
|
1247
|
-
// );
|
|
1248
|
-
|
|
1249
|
-
let findUnpkgModel = false;
|
|
1250
1231
|
const webpackRequireLPatternEval = /"https:\/\/unpkg\.com"/g;
|
|
1251
|
-
if (webpackRequireLPatternEval.test(content)) {
|
|
1252
|
-
|
|
1232
|
+
// if (webpackRequireLPatternEval.test(content)) {
|
|
1233
|
+
// webpackRequireLPatternEval.lastIndex = 0;
|
|
1253
1234
|
verbose('检测到 转码 unpkg.com 模式');
|
|
1254
1235
|
content = content.replace(webpackRequireLPatternEval, 'window.ArkConfig.cdnHost');
|
|
1255
|
-
|
|
1256
|
-
}
|
|
1236
|
+
// }
|
|
1257
1237
|
|
|
1258
1238
|
const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
1259
|
-
if (webpackRequireLPattern.test(content)) {
|
|
1260
|
-
webpackRequireLPattern.lastIndex = 0;
|
|
1261
|
-
findUnpkgModel = true;
|
|
1262
1239
|
verbose('检测到 unpkg.com 模式');
|
|
1263
1240
|
content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
|
|
1264
|
-
}
|
|
1241
|
+
// }
|
|
1265
1242
|
|
|
1266
|
-
if (findUnpkgModel) {
|
|
1243
|
+
// if (findUnpkgModel) {
|
|
1267
1244
|
// 更新资源
|
|
1268
1245
|
compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
|
|
1269
|
-
}
|
|
1246
|
+
// }
|
|
1270
1247
|
|
|
1271
1248
|
});
|
|
1272
1249
|
}
|
package/dist/index.min.js
CHANGED
|
@@ -1228,45 +1228,22 @@
|
|
|
1228
1228
|
}
|
|
1229
1229
|
|
|
1230
1230
|
let content = source.source().toString();
|
|
1231
|
-
|
|
1232
|
-
// 替换逻辑
|
|
1233
|
-
// /(__webpack_require__\.l)\(url,/g)
|
|
1234
|
-
// const webpackRequireLPattern = /(__webpack_require__\.l)\(url,/g;
|
|
1235
|
-
// if (webpackRequireLPattern.test(content)) {
|
|
1236
|
-
// verbose('检测到 __webpack_require__.l 模式');
|
|
1237
|
-
// content = content.replace(
|
|
1238
|
-
// webpackRequireLPattern,
|
|
1239
|
-
// `(function(url, done, key, chunkId) {
|
|
1240
|
-
// if (typeof window.ArkConfig !== 'undefined' && window.ArkConfig.cdnHost) {
|
|
1241
|
-
// if (!url.startsWith(window.ArkConfig.cdnHost) && url.startsWith('https://unpkg.com')) {
|
|
1242
|
-
// url = window.ArkConfig.cdnHost + url.slice('https://unpkg.com'.length);
|
|
1243
|
-
// }
|
|
1244
|
-
// }
|
|
1245
|
-
// return $1(url, done, key, chunkId);
|
|
1246
|
-
// })(url,`
|
|
1247
|
-
// );
|
|
1248
|
-
|
|
1249
|
-
let findUnpkgModel = false;
|
|
1250
1231
|
const webpackRequireLPatternEval = /"https:\/\/unpkg\.com"/g;
|
|
1251
|
-
if (webpackRequireLPatternEval.test(content)) {
|
|
1252
|
-
|
|
1232
|
+
// if (webpackRequireLPatternEval.test(content)) {
|
|
1233
|
+
// webpackRequireLPatternEval.lastIndex = 0;
|
|
1253
1234
|
verbose('检测到 转码 unpkg.com 模式');
|
|
1254
1235
|
content = content.replace(webpackRequireLPatternEval, 'window.ArkConfig.cdnHost');
|
|
1255
|
-
|
|
1256
|
-
}
|
|
1236
|
+
// }
|
|
1257
1237
|
|
|
1258
1238
|
const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
1259
|
-
if (webpackRequireLPattern.test(content)) {
|
|
1260
|
-
webpackRequireLPattern.lastIndex = 0;
|
|
1261
|
-
findUnpkgModel = true;
|
|
1262
1239
|
verbose('检测到 unpkg.com 模式');
|
|
1263
1240
|
content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
|
|
1264
|
-
}
|
|
1241
|
+
// }
|
|
1265
1242
|
|
|
1266
|
-
if (findUnpkgModel) {
|
|
1243
|
+
// if (findUnpkgModel) {
|
|
1267
1244
|
// 更新资源
|
|
1268
1245
|
compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
|
|
1269
|
-
}
|
|
1246
|
+
// }
|
|
1270
1247
|
|
|
1271
1248
|
});
|
|
1272
1249
|
}
|
package/lib/index.js
CHANGED
|
@@ -1233,45 +1233,22 @@ class ArkWebpackPlugin {
|
|
|
1233
1233
|
}
|
|
1234
1234
|
|
|
1235
1235
|
let content = source.source().toString();
|
|
1236
|
-
|
|
1237
|
-
// 替换逻辑
|
|
1238
|
-
// /(__webpack_require__\.l)\(url,/g)
|
|
1239
|
-
// const webpackRequireLPattern = /(__webpack_require__\.l)\(url,/g;
|
|
1240
|
-
// if (webpackRequireLPattern.test(content)) {
|
|
1241
|
-
// verbose('检测到 __webpack_require__.l 模式');
|
|
1242
|
-
// content = content.replace(
|
|
1243
|
-
// webpackRequireLPattern,
|
|
1244
|
-
// `(function(url, done, key, chunkId) {
|
|
1245
|
-
// if (typeof window.ArkConfig !== 'undefined' && window.ArkConfig.cdnHost) {
|
|
1246
|
-
// if (!url.startsWith(window.ArkConfig.cdnHost) && url.startsWith('https://unpkg.com')) {
|
|
1247
|
-
// url = window.ArkConfig.cdnHost + url.slice('https://unpkg.com'.length);
|
|
1248
|
-
// }
|
|
1249
|
-
// }
|
|
1250
|
-
// return $1(url, done, key, chunkId);
|
|
1251
|
-
// })(url,`
|
|
1252
|
-
// );
|
|
1253
|
-
|
|
1254
|
-
let findUnpkgModel = false;
|
|
1255
1236
|
const webpackRequireLPatternEval = /"https:\/\/unpkg\.com"/g;
|
|
1256
|
-
if (webpackRequireLPatternEval.test(content)) {
|
|
1257
|
-
|
|
1237
|
+
// if (webpackRequireLPatternEval.test(content)) {
|
|
1238
|
+
// webpackRequireLPatternEval.lastIndex = 0;
|
|
1258
1239
|
verbose('检测到 转码 unpkg.com 模式');
|
|
1259
1240
|
content = content.replace(webpackRequireLPatternEval, 'window.ArkConfig.cdnHost');
|
|
1260
|
-
|
|
1261
|
-
}
|
|
1241
|
+
// }
|
|
1262
1242
|
|
|
1263
1243
|
const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
1264
|
-
if (webpackRequireLPattern.test(content)) {
|
|
1265
|
-
webpackRequireLPattern.lastIndex = 0;
|
|
1266
|
-
findUnpkgModel = true;
|
|
1267
1244
|
verbose('检测到 unpkg.com 模式');
|
|
1268
1245
|
content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
|
|
1269
|
-
}
|
|
1246
|
+
// }
|
|
1270
1247
|
|
|
1271
|
-
if (findUnpkgModel) {
|
|
1248
|
+
// if (findUnpkgModel) {
|
|
1272
1249
|
// 更新资源
|
|
1273
1250
|
compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
|
|
1274
|
-
}
|
|
1251
|
+
// }
|
|
1275
1252
|
|
|
1276
1253
|
});
|
|
1277
1254
|
}
|
package/package.json
CHANGED
package/src/ArkWebpackPlugin.js
CHANGED
|
@@ -73,25 +73,25 @@ export default class ArkWebpackPlugin {
|
|
|
73
73
|
|
|
74
74
|
let findUnpkgModel = false;
|
|
75
75
|
const webpackRequireLPatternEval = /"https:\/\/unpkg\.com"/g;
|
|
76
|
-
if (webpackRequireLPatternEval.test(content)) {
|
|
77
|
-
|
|
76
|
+
// if (webpackRequireLPatternEval.test(content)) {
|
|
77
|
+
// webpackRequireLPatternEval.lastIndex = 0;
|
|
78
78
|
verbose('检测到 转码 unpkg.com 模式');
|
|
79
79
|
content = content.replace(webpackRequireLPatternEval, 'window.ArkConfig.cdnHost');
|
|
80
80
|
findUnpkgModel = true;
|
|
81
|
-
}
|
|
81
|
+
// }
|
|
82
82
|
|
|
83
83
|
const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
84
|
-
if (webpackRequireLPattern.test(content)) {
|
|
85
|
-
|
|
84
|
+
// if (webpackRequireLPattern.test(content)) {
|
|
85
|
+
// webpackRequireLPattern.lastIndex = 0;
|
|
86
86
|
findUnpkgModel = true;
|
|
87
87
|
verbose('检测到 unpkg.com 模式');
|
|
88
88
|
content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
|
|
89
|
-
}
|
|
89
|
+
// }
|
|
90
90
|
|
|
91
|
-
if (findUnpkgModel) {
|
|
91
|
+
// if (findUnpkgModel) {
|
|
92
92
|
// 更新资源
|
|
93
93
|
compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
|
|
94
|
-
}
|
|
94
|
+
// }
|
|
95
95
|
|
|
96
96
|
});
|
|
97
97
|
}
|