-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support optional @vue/compiler-sfc peer dep
- Loading branch information
Showing
9 changed files
with
145 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// extend the descriptor so we can store the scopeId on it | ||
declare module '@vue/compiler-sfc' { | ||
interface SFCDescriptor { | ||
id: string | ||
} | ||
} | ||
|
||
import * as _compiler from '@vue/compiler-sfc' | ||
|
||
export let compiler: typeof _compiler | ||
|
||
try { | ||
// Vue 3.2.13+ ships the SFC compiler directly under the `vue` package | ||
// making it no longer necessary to have @vue/compiler-sfc separately installed. | ||
compiler = require('vue/compiler-sfc') | ||
} catch (e) { | ||
try { | ||
compiler = require('@vue/compiler-sfc') | ||
} catch (e) { | ||
throw new Error( | ||
`@vitejs/plugin-vue requires vue (>=3.2.13) or @vue/compiler-sfc ` + | ||
`to be present in the dependency tree.` | ||
) | ||
} | ||
} |
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
21725a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as my comment in 11e3cb8: why is there no official release on Github for this?