@arkxio/ark-dev-utils 0.1.11 → 0.1.13
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 +8 -30
- package/dist/index.min.js +8 -30
- package/lib/index.js +8 -30
- package/package.json +1 -1
- package/src/ArkWebpackPlugin.js +10 -9
package/dist/index.js
CHANGED
|
@@ -1228,45 +1228,23 @@
|
|
|
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
|
-
const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
1259
|
-
|
|
1260
|
-
webpackRequireLPattern.lastIndex = 0;
|
|
1261
|
-
findUnpkgModel = true;
|
|
1238
|
+
// const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
1239
|
+
const webpackRequireLPattern = /(?<!\\)"(https:\/\/unpkg\.com)/g;
|
|
1262
1240
|
verbose('检测到 unpkg.com 模式');
|
|
1263
1241
|
content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
|
|
1264
|
-
}
|
|
1242
|
+
// }
|
|
1265
1243
|
|
|
1266
|
-
if (findUnpkgModel) {
|
|
1244
|
+
// if (findUnpkgModel) {
|
|
1267
1245
|
// 更新资源
|
|
1268
1246
|
compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
|
|
1269
|
-
}
|
|
1247
|
+
// }
|
|
1270
1248
|
|
|
1271
1249
|
});
|
|
1272
1250
|
}
|
package/dist/index.min.js
CHANGED
|
@@ -1228,45 +1228,23 @@
|
|
|
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
|
-
const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
1259
|
-
|
|
1260
|
-
webpackRequireLPattern.lastIndex = 0;
|
|
1261
|
-
findUnpkgModel = true;
|
|
1238
|
+
// const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
1239
|
+
const webpackRequireLPattern = /(?<!\\)"(https:\/\/unpkg\.com)/g;
|
|
1262
1240
|
verbose('检测到 unpkg.com 模式');
|
|
1263
1241
|
content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
|
|
1264
|
-
}
|
|
1242
|
+
// }
|
|
1265
1243
|
|
|
1266
|
-
if (findUnpkgModel) {
|
|
1244
|
+
// if (findUnpkgModel) {
|
|
1267
1245
|
// 更新资源
|
|
1268
1246
|
compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
|
|
1269
|
-
}
|
|
1247
|
+
// }
|
|
1270
1248
|
|
|
1271
1249
|
});
|
|
1272
1250
|
}
|
package/lib/index.js
CHANGED
|
@@ -1233,45 +1233,23 @@ 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
|
-
const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
1264
|
-
|
|
1265
|
-
webpackRequireLPattern.lastIndex = 0;
|
|
1266
|
-
findUnpkgModel = true;
|
|
1243
|
+
// const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
1244
|
+
const webpackRequireLPattern = /(?<!\\)"(https:\/\/unpkg\.com)/g;
|
|
1267
1245
|
verbose('检测到 unpkg.com 模式');
|
|
1268
1246
|
content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
|
|
1269
|
-
}
|
|
1247
|
+
// }
|
|
1270
1248
|
|
|
1271
|
-
if (findUnpkgModel) {
|
|
1249
|
+
// if (findUnpkgModel) {
|
|
1272
1250
|
// 更新资源
|
|
1273
1251
|
compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
|
|
1274
|
-
}
|
|
1252
|
+
// }
|
|
1275
1253
|
|
|
1276
1254
|
});
|
|
1277
1255
|
}
|
package/package.json
CHANGED
package/src/ArkWebpackPlugin.js
CHANGED
|
@@ -73,25 +73,26 @@ 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
|
-
const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
// const webpackRequireLPattern = /"(https:\/\/unpkg\.com)/g;
|
|
84
|
+
const webpackRequireLPattern = /(?<!\\)"(https:\/\/unpkg\.com)/g;
|
|
85
|
+
// if (webpackRequireLPattern.test(content)) {
|
|
86
|
+
// webpackRequireLPattern.lastIndex = 0;
|
|
86
87
|
findUnpkgModel = true;
|
|
87
88
|
verbose('检测到 unpkg.com 模式');
|
|
88
89
|
content = content.replace(webpackRequireLPattern,`window.ArkConfig.cdnHost + "`);
|
|
89
|
-
}
|
|
90
|
+
// }
|
|
90
91
|
|
|
91
|
-
if (findUnpkgModel) {
|
|
92
|
+
// if (findUnpkgModel) {
|
|
92
93
|
// 更新资源
|
|
93
94
|
compilation.updateAsset(filename, new compiler.webpack.sources.RawSource(content));
|
|
94
|
-
}
|
|
95
|
+
// }
|
|
95
96
|
|
|
96
97
|
});
|
|
97
98
|
}
|