yangjie #51
2
build.js
2
build.js
|
|
@ -8,7 +8,7 @@ const timestamp = new Date().getTime();
|
||||||
// 正则表达式匹配JS文件引用并添加时间戳
|
// 正则表达式匹配JS文件引用并添加时间戳
|
||||||
indexHtml = indexHtml.replace(/<script type="module" crossorigin src="([^"]+)">/g, (match, p1) => {
|
indexHtml = indexHtml.replace(/<script type="module" crossorigin src="([^"]+)">/g, (match, p1) => {
|
||||||
if (p1.endsWith('.js')) {
|
if (p1.endsWith('.js')) {
|
||||||
return `<script src="${p1}?t=${timestamp}"></script>`;
|
return `<script type="module" crossorigin src="${p1}?t=${timestamp}"></script>`;
|
||||||
}
|
}
|
||||||
return match;
|
return match;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue