-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Vue
appEntrypoint
handling (#8794)
Co-authored-by: Nate Moore <[email protected]> Co-authored-by: Arsh <[email protected]> Co-authored-by: Florian LEFEBVRE <[email protected]> Co-authored-by: Nate Moore <[email protected]>
- Loading branch information
1 parent
874f68c
commit 4d4e34d
Showing
18 changed files
with
257 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@astrojs/vue': patch | ||
--- | ||
|
||
Prevents Astro from crashing when no default function is exported from the `appEntrypoint`. Now, the entrypoint will be ignored with a warning instead. |
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
14 changes: 14 additions & 0 deletions
14
packages/integrations/vue/test/fixtures/app-entrypoint-no-export-default/astro.config.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,14 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import vue from '@astrojs/vue'; | ||
import ViteSvgLoader from 'vite-svg-loader' | ||
|
||
export default defineConfig({ | ||
integrations: [vue({ | ||
appEntrypoint: '/src/pages/_app' | ||
})], | ||
vite: { | ||
plugins: [ | ||
ViteSvgLoader(), | ||
], | ||
}, | ||
}) |
13 changes: 13 additions & 0 deletions
13
packages/integrations/vue/test/fixtures/app-entrypoint-no-export-default/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,13 @@ | ||
{ | ||
"name": "@test/vue-app-entrypoint-no-export-default", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/vue": "workspace:*", | ||
"astro": "workspace:*", | ||
"vite-svg-loader": "4.0.0" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...es/integrations/vue/test/fixtures/app-entrypoint-no-export-default/src/components/Bar.vue
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 @@ | ||
<template> | ||
<div id="bar">works</div> | ||
</template> |
1 change: 1 addition & 0 deletions
1
...ns/vue/test/fixtures/app-entrypoint-no-export-default/src/components/Circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions
11
...es/integrations/vue/test/fixtures/app-entrypoint-no-export-default/src/components/Foo.vue
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 Bar from './Bar.vue' | ||
import Circle from './Circle.svg?component' | ||
</script> | ||
|
||
<template> | ||
<div id="foo"> | ||
<Bar /> | ||
<Circle/> | ||
</div> | ||
</template> |
3 changes: 3 additions & 0 deletions
3
packages/integrations/vue/test/fixtures/app-entrypoint-no-export-default/src/pages/_app.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,3 @@ | ||
console.log(123); | ||
|
||
// no default export |
12 changes: 12 additions & 0 deletions
12
...ges/integrations/vue/test/fixtures/app-entrypoint-no-export-default/src/pages/index.astro
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,12 @@ | ||
--- | ||
import Foo from '../components/Foo.vue'; | ||
--- | ||
|
||
<html> | ||
<head> | ||
<title>Vue App Entrypoint</title> | ||
</head> | ||
<body> | ||
<Foo client:load /> | ||
</body> | ||
</html> |
8 changes: 8 additions & 0 deletions
8
packages/integrations/vue/test/fixtures/app-entrypoint-relative/astro.config.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,8 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import vue from '@astrojs/vue'; | ||
|
||
export default defineConfig({ | ||
integrations: [vue({ | ||
appEntrypoint: './src/vue.ts' | ||
})] | ||
}) |
12 changes: 12 additions & 0 deletions
12
packages/integrations/vue/test/fixtures/app-entrypoint-relative/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,12 @@ | ||
{ | ||
"name": "@test/vue-app-entrypoint-relative", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/vue": "workspace:*", | ||
"astro": "workspace:*" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/integrations/vue/test/fixtures/app-entrypoint-relative/src/components/Bar.vue
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 @@ | ||
<template> | ||
<div id="bar">works</div> | ||
</template> |
1 change: 1 addition & 0 deletions
1
...ntegrations/vue/test/fixtures/app-entrypoint-relative/src/components/Circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions
11
packages/integrations/vue/test/fixtures/app-entrypoint-relative/src/components/Foo.vue
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 Bar from './Bar.vue' | ||
import Circle from './Circle.svg?component' | ||
</script> | ||
|
||
<template> | ||
<div id="foo"> | ||
<Bar /> | ||
<Circle/> | ||
</div> | ||
</template> |
12 changes: 12 additions & 0 deletions
12
packages/integrations/vue/test/fixtures/app-entrypoint-relative/src/pages/index.astro
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,12 @@ | ||
--- | ||
import Foo from '../components/Foo.vue'; | ||
--- | ||
|
||
<html> | ||
<head> | ||
<title>Vue App Entrypoint</title> | ||
</head> | ||
<body> | ||
<Foo client:load /> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
packages/integrations/vue/test/fixtures/app-entrypoint-relative/src/vue.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 @@ | ||
export default () => {} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.