forked from MarvelSQ/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.
fix: preserve default export from externalized packages (fixes vitejs…
…#10258) (vitejs#10406) fixes vitejs#10258
- Loading branch information
1 parent
d6b4ee5
commit 7fa6762
Showing
15 changed files
with
119 additions
and
55 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
import { version } from 'vue' | ||
import slash5 from 'slash5' | ||
import slash3 from 'slash3' | ||
|
||
document.querySelector('#imported-vue-version').textContent = version | ||
document.querySelector('#imported-slash5-exists').textContent = | ||
!!slash5('foo/bar') | ||
document.querySelector('#imported-slash3-exists').textContent = | ||
!!slash3('foo/bar') |
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 @@ | ||
{ | ||
"name": "@vitejs/dep-that-imports", | ||
"private": true, | ||
"version": "0.0.0", | ||
"dependencies": { | ||
"slash3": "npm:slash@^3.0.0", | ||
"slash5": "npm:slash@^5.0.0", | ||
"vue": "^3.2.45" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
const { version } = require('vue') | ||
// require('slash5') // cannot require ESM | ||
const slash3 = require('slash3') | ||
|
||
document.querySelector('#required-vue-version').textContent = version | ||
document.querySelector('#required-slash3-exists').textContent = | ||
!!slash3('foo/bar') |
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 @@ | ||
{ | ||
"name": "@vitejs/dep-that-requires", | ||
"private": true, | ||
"version": "0.0.0", | ||
"dependencies": { | ||
"slash3": "npm:slash@^3.0.0", | ||
"slash5": "npm:slash@^5.0.0", | ||
"vue": "^3.2.45" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import '@vitejs/dep-that-imports-vue' | ||
import '@vitejs/dep-that-requires-vue' | ||
import '@vitejs/dep-that-imports' | ||
import '@vitejs/dep-that-requires' |
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,13 +1,17 @@ | ||
import { defineConfig } from 'vite' | ||
|
||
export default defineConfig({ | ||
optimizeDeps: { | ||
include: ['dep-that-imports', 'dep-that-requires'], | ||
exclude: ['vue', 'slash5'] | ||
}, | ||
build: { | ||
minify: false, | ||
rollupOptions: { | ||
external: ['vue'] | ||
external: ['vue', 'slash3', 'slash5'] | ||
}, | ||
commonjsOptions: { | ||
esmExternals: ['vue'] | ||
esmExternals: ['vue', 'slash5'] | ||
} | ||
} | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.