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
1 parent
526cf23
commit 3ba7436
Showing
123 changed files
with
3,722 additions
and
20 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
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 @@ | ||
export const a = 'a' |
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 @@ | ||
export const b = 'b' |
3 changes: 3 additions & 0 deletions
3
packages/vite/src/node/ssr/runtime/__tests__/fixtures/basic.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,3 @@ | ||
export const name = 'basic' | ||
|
||
export const meta = import.meta |
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 @@ | ||
/* eslint-disable no-console */ | ||
|
||
export { a as c } from './a' | ||
|
||
import.meta.hot?.accept(() => { | ||
console.log('accept c') | ||
}) |
2 changes: 2 additions & 0 deletions
2
packages/vite/src/node/ssr/runtime/__tests__/fixtures/circular/circular-a.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,2 @@ | ||
export { b } from './circular-b' | ||
export const a = 'a' |
2 changes: 2 additions & 0 deletions
2
packages/vite/src/node/ssr/runtime/__tests__/fixtures/circular/circular-b.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,2 @@ | ||
export { a } from './circular-a' | ||
export const b = 'b' |
8 changes: 8 additions & 0 deletions
8
packages/vite/src/node/ssr/runtime/__tests__/fixtures/circular/circular-index.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,8 @@ | ||
export { a } from './circular-a' | ||
export { b } from './circular-b' | ||
|
||
// since there is no .accept, it does full reload | ||
import.meta.hot.on('vite:beforeFullReload', () => { | ||
// eslint-disable-next-line no-console | ||
console.log('full reload') | ||
}) |
3 changes: 3 additions & 0 deletions
3
packages/vite/src/node/ssr/runtime/__tests__/fixtures/cjs-external-existing.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,3 @@ | ||
import { hello } from '@vitejs/cjs-external' | ||
|
||
export const result = hello() |
4 changes: 4 additions & 0 deletions
4
packages/vite/src/node/ssr/runtime/__tests__/fixtures/cjs-external-non-existing.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,4 @@ | ||
import { nonExisting } from '@vitejs/cjs-external' | ||
|
||
// eslint-disable-next-line no-console | ||
console.log(nonExisting) |
3 changes: 3 additions & 0 deletions
3
packages/vite/src/node/ssr/runtime/__tests__/fixtures/cjs-external/index.cjs
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 @@ | ||
module.exports = { | ||
hello: () => 'world', | ||
} |
7 changes: 7 additions & 0 deletions
7
packages/vite/src/node/ssr/runtime/__tests__/fixtures/cjs-external/package.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,7 @@ | ||
{ | ||
"name": "@vitejs/cjs-external", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "commonjs", | ||
"main": "index.cjs" | ||
} |
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 @@ | ||
/* eslint-disable no-console */ | ||
|
||
export { c as d } from './c' | ||
|
||
import.meta.hot?.accept(() => { | ||
console.log('accept d') | ||
}) |
14 changes: 14 additions & 0 deletions
14
packages/vite/src/node/ssr/runtime/__tests__/fixtures/dynamic-import.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,14 @@ | ||
import * as staticModule from './basic' | ||
|
||
export const initialize = async () => { | ||
const nameRelative = './basic' | ||
const nameAbsolute = '/fixtures/basic' | ||
const nameAbsoluteExtension = '/fixtures/basic.js' | ||
return { | ||
dynamicProcessed: await import('./basic'), | ||
dynamicRelative: await import(nameRelative), | ||
dynamicAbsolute: await import(nameAbsolute), | ||
dynamicAbsoluteExtension: await import(nameAbsoluteExtension), | ||
static: staticModule, | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/vite/src/node/ssr/runtime/__tests__/fixtures/esm-external-existing.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,3 @@ | ||
import { hello } from '@vitejs/esm-external' | ||
|
||
export const result = hello() |
4 changes: 4 additions & 0 deletions
4
packages/vite/src/node/ssr/runtime/__tests__/fixtures/esm-external-non-existing.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,4 @@ | ||
import { nonExisting } from '@vitejs/esm-external' | ||
|
||
// eslint-disable-next-line no-console | ||
console.log(nonExisting) |
1 change: 1 addition & 0 deletions
1
packages/vite/src/node/ssr/runtime/__tests__/fixtures/esm-external/index.mjs
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 @@ | ||
export const hello = () => 'world' |
Oops, something went wrong.