forked from vitejs/vite
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
118 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { test } from 'vitest' | ||
import { editFile, isBuild, page, viteTestUrl } from '../../test-utils' | ||
|
||
test('basic', async () => { | ||
await page.getByRole('button', { name: 'Count: 0' }).click() | ||
await page.getByRole('button', { name: 'Count: 1' }).click() | ||
}) | ||
|
||
test.runIf(!isBuild)('hmr js', async () => { | ||
await page.goto(viteTestUrl) | ||
await page.getByRole('button', { name: 'Count: 0' }).click() | ||
|
||
editFile('./src/App.vue', (s) => s.replace('Count:', 'Count-x:')) | ||
await page.getByRole('button', { name: 'Count-x: 1' }).click() | ||
|
||
editFile('./src/app.tsx', (s) => s.replace('Count-x:', 'Count:')) | ||
await page.getByRole('button', { name: 'Count: 2' }).click() | ||
}) |
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,10 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
</html> |
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,16 @@ | ||
{ | ||
"name": "@vitejs/test-rolldown-dev-vue", | ||
"private": true, | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"vue": "^3.5.13" | ||
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^5.2.1" | ||
} | ||
} |
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 @@ | ||
<script setup> | ||
import { ref } from 'vue' | ||
const count = ref(0) | ||
</script> | ||
|
||
<template> | ||
<h1>Vite + Vue</h1> | ||
<button type="button" @click="count++">Count: {{ count }}</button> | ||
</template> | ||
|
||
<!-- TODO: scoped css --> |
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,4 @@ | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
|
||
createApp(App).mount('#app') |
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,20 @@ | ||
import { defineConfig } from 'vite' | ||
import vue from '@vitejs/plugin-vue' | ||
|
||
export default defineConfig({ | ||
clearScreen: false, | ||
experimental: { | ||
rolldownDev: { | ||
hmr: true, | ||
}, | ||
}, | ||
plugins: [ | ||
vue(), | ||
{ | ||
name: 'debug', | ||
buildEnd(err) { | ||
console.log('[buildEnd]', err) | ||
}, | ||
}, | ||
], | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.