-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Vite Bundle Size Action Example Demonstrating Vite Errors with library #7970
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
*.local |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite App</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script> | ||
if(global === undefined){ | ||
global = window; | ||
} | ||
</script> | ||
|
||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
</html> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "vite", | ||
"version": "0.0.0", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"serve": "vite preview" | ||
}, | ||
"dependencies": { | ||
"aws-amplify": "^3.3.25", | ||
"vue": "^3.0.5" | ||
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^1.1.5", | ||
"@vue/compiler-sfc": "^3.0.5", | ||
"vite": "^2.1.0" | ||
Comment on lines
+14
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what's configured after a |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<template> | ||
<img alt="Vue logo" src="./assets/logo.png" /> | ||
<HelloWorld msg="Hello Vue 3 + Vite" /> | ||
</template> | ||
|
||
<script setup> | ||
import HelloWorld from './components/HelloWorld.vue' | ||
|
||
// This starter template is using Vue 3 experimental <script setup> SFCs | ||
// Check out https://github.com/vuejs/rfcs/blob/script-setup-2/active-rfcs/0000-script-setup.md | ||
</script> | ||
|
||
<style> | ||
#app { | ||
font-family: Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: 60px; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<template> | ||
<h1>{{ msg }}</h1> | ||
|
||
<p> | ||
<a href="https://vitejs.dev/guide/features.html" target="_blank">Vite Documentation</a> | | ||
<a href="https://v3.vuejs.org/" target="_blank">Vue 3 Documentation</a> | ||
</p> | ||
|
||
<button @click="state.count++">count is: {{ state.count }}</button> | ||
<p> | ||
Edit | ||
<code>components/HelloWorld.vue</code> to test hot module replacement. | ||
</p> | ||
</template> | ||
|
||
<script setup> | ||
import { defineProps, reactive } from 'vue' | ||
|
||
defineProps({ | ||
msg: String | ||
}) | ||
|
||
const state = reactive({ count: 0 }) | ||
</script> | ||
|
||
<style scoped> | ||
a { | ||
color: #42b983; | ||
} | ||
</style> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { createApp } from 'vue' | ||
import App from './App.vue' | ||
|
||
|
||
|
||
import Amplify, { Auth } from 'aws-amplify'; | ||
|
||
Amplify.configure({}); | ||
createApp(App).mount('#app') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineConfig } from 'vite'; | ||
import vue from '@vitejs/plugin-vue'; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig({ | ||
plugins: [vue()], | ||
build: { | ||
rollupOptions: { | ||
output: { | ||
intro: 'const global = window;', | ||
}, | ||
}, | ||
}, | ||
}); |
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.
yarn dev
initially failed for me, then I changed this to:Now
yarn dev
works! Butyarn build
still fails...