Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Merge remote-tracking branch 'vite/main' into feat/worker-sour…
…cemaps # Conflicts: # packages/vite/src/node/plugins/worker.ts # packages/vite/src/node/plugins/workerImportMetaUrl.ts
- Loading branch information
Showing
47 changed files
with
554 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
packages/playground/fs-serve/root/src/special characters åäö/safe.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"msg": "safe" | ||
} |
1 change: 1 addition & 0 deletions
1
packages/playground/fs-serve/root/src/special characters åäö/safe.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
KEY=safe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/playground/tailwind-sourcemap/__tests__/build.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { isBuild } from 'testUtils' | ||
|
||
if (isBuild) { | ||
test('should not output sourcemap warning (#4939)', () => { | ||
serverLogs.forEach((log) => { | ||
expect(log).not.toMatch('Sourcemap is likely to be incorrect') | ||
}) | ||
}) | ||
} else { | ||
test('this file only includes test for build', () => { | ||
expect(true).toBe(true) | ||
}) | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/playground/tailwind-sourcemap/__tests__/serve.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { isBuild } from 'testUtils' | ||
|
||
if (!isBuild) { | ||
test('should not output missing source file warning', () => { | ||
serverLogs.forEach((log) => { | ||
expect(log).not.toMatch(/Sourcemap for .+ points to missing source files/) | ||
}) | ||
}) | ||
} else { | ||
test('this file only includes test for serve', () => { | ||
expect(true).toBe(true) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<div class="wrapper"> | ||
<h1>Tailwind Sourcemap</h1> | ||
|
||
<p class="text-red-400">foo</p> | ||
</div> | ||
|
||
<script type="module"> | ||
import './tailwind.css' | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "test-tailwind-sourcemap", | ||
"private": true, | ||
"version": "0.0.0", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"debug": "node --inspect-brk ../../vite/bin/vite", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"tailwindcss": "^3.0.23" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
plugins: { | ||
tailwindcss: { config: __dirname + '/tailwind.config.js' } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
content: ['./index.html'], | ||
theme: { | ||
extend: {} | ||
}, | ||
plugins: [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* @type {import('vite').UserConfig} | ||
*/ | ||
module.exports = { | ||
css: { | ||
devSourcemap: true | ||
}, | ||
build: { | ||
sourcemap: true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<h2>worker template error match</h2> | ||
<code> | ||
const worker = new Worker(new URL('./worker.js', import.meta.url)) | ||
</code> | ||
<div class="vue-worker">{{ message }}</div> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue' | ||
const message = ref('') | ||
const worker = new Worker(new URL('./workerTest.js', import.meta.url)) | ||
worker.addEventListener('message', (ev) => { | ||
message.value = ev.data | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
self.postMessage('worker load!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
import SubWorker from './emit-chunk-sub-worker?worker' | ||
|
||
const subWorker = new SubWorker() | ||
|
||
subWorker.onmessage = (event) => { | ||
self.postMessage(event.data) | ||
self.postMessage({ | ||
type: 'emit-chunk-sub-worker', | ||
data: event.data | ||
}) | ||
} | ||
|
||
const moduleWorker = new Worker( | ||
new URL('./module-and-worker.js', import.meta.url), | ||
{ type: 'module' } | ||
) | ||
|
||
moduleWorker.onmessage = (event) => { | ||
self.postMessage({ | ||
type: 'module-and-worker:worker', | ||
data: event.data | ||
}) | ||
} | ||
|
||
import('./module-and-worker').then((res) => { | ||
self.postMessage({ | ||
type: 'module-and-worker:module', | ||
data: res.module | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
Promise.all([import('./modules/module2'), import('./modules/module3')]).then( | ||
(data) => { | ||
const _data = { ...data[0], ...data[1] } | ||
self.postMessage(_data) | ||
} | ||
) | ||
Promise.all([ | ||
import('./module-and-worker'), | ||
import('./modules/module2'), | ||
import('./modules/module3') | ||
]).then((data) => { | ||
const _data = { ...data[0], ...data[1], ...data[2] } | ||
self.postMessage(_data) | ||
}) |
Oops, something went wrong.