-
Notifications
You must be signed in to change notification settings - Fork 20
/
vite+3.0.9.patch
62 lines (62 loc) · 3.45 KB
/
vite+3.0.9.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
diff --git a/node_modules/vite/dist/node/chunks/dep-0fc8e132.js b/node_modules/vite/dist/node/chunks/dep-0fc8e132.js
index 54ffaf0..653c4d4 100644
--- a/node_modules/vite/dist/node/chunks/dep-0fc8e132.js
+++ b/node_modules/vite/dist/node/chunks/dep-0fc8e132.js
@@ -12002,6 +12002,10 @@ function copyDir(srcDir, destDir) {
const destFile = path$n.resolve(destDir, file);
const stat = fs$l.statSync(srcFile);
if (stat.isDirectory()) {
+ if (file === 'tera') {
+ fs$l.symlinkSync(srcFile, destFile);
+ continue;
+ }
copyDir(srcFile, destFile);
}
else {
@@ -39580,6 +39584,10 @@ const sirvOptions = (headers) => {
if (/\.[tj]sx?$/.test(pathname)) {
res.setHeader('Content-Type', 'application/javascript');
}
+ // custom mime type
+ if (pathname.endsWith('.fp16.br')) {
+ res.setHeader('Content-Type', 'application/octet-stream');
+ }
if (headers) {
for (const name in headers) {
res.setHeader(name, headers[name]);
@@ -40203,7 +40211,7 @@ function importAnalysisPlugin(config) {
// properly finish the request with a 504 sent to the browser.
throwOutdatedRequest(importer);
}
- if (!imports.length) {
+ if (!imports.length && !this._addedImports) {
importerModule.isSelfAccepting = false;
isDebug$1 &&
debug$7(`${timeFrom(start)} ${picocolors.exports.dim(`[no imports] ${prettyImporter}`)}`);
@@ -40224,7 +40232,7 @@ function importAnalysisPlugin(config) {
? new Map()
: null;
const toAbsoluteUrl = (url) => path$n.posix.resolve(path$n.posix.dirname(importerModule.url), url);
- const normalizeUrl = async (url, pos) => {
+ const normalizeUrl = async (url, pos, forceSkipImportAnalysis) => {
if (base !== '/' && url.startsWith(base)) {
url = url.replace(base, '/');
}
@@ -40303,7 +40311,7 @@ function importAnalysisPlugin(config) {
// up-to-date version of this module.
try {
// delay setting `isSelfAccepting` until the file is actually used (#7870)
- const depModule = await moduleGraph.ensureEntryFromUrl(url, ssr, canSkipImportAnalysis(url));
+ const depModule = await moduleGraph.ensureEntryFromUrl(url, ssr, canSkipImportAnalysis(url) || forceSkipImportAnalysis);
if (depModule.lastHMRTimestamp > 0) {
url = injectQuery(url, `t=${depModule.lastHMRTimestamp}`);
}
@@ -40518,7 +40526,7 @@ function importAnalysisPlugin(config) {
// attached by pluginContainer.addWatchFile
const pluginImports = this._addedImports;
if (pluginImports) {
- (await Promise.all([...pluginImports].map((id) => normalizeUrl(id, 0)))).forEach(([url]) => importedUrls.add(url));
+ (await Promise.all([...pluginImports].map((id) => normalizeUrl(id, 0, true)))).forEach(([url]) => importedUrls.add(url));
}
// HMR transforms are no-ops in SSR, so an `accept` call will
// never be injected. Avoid updating the `isSelfAccepting`