Created
May 21, 2020 16:33
-
-
Save jakedohm/1d792d0e02cdaaa9deb9044a4e715de9 to your computer and use it in GitHub Desktop.
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
// Import our CSS | |
import styles from '../css/app.pcss'; | |
import VueConfetti from 'vue-confetti'; | |
// App main | |
const main = async () => { | |
// Async load the vue module | |
const { createApp, defineAsyncComponent } = await import(/* webpackChunkName: "vue" */ 'vue'); | |
// Create our root vue instance | |
const root = createApp({ | |
components: { | |
'confetti': defineAsyncComponent(() => import(/* webpackChunkName: "confetti" */ '../vue/Confetti.vue')), | |
}, | |
data: () => ({ | |
}), | |
methods: { | |
}, | |
mounted() { | |
}, | |
}); | |
root.use(VueConfetti); | |
root.mount("#page-container"); | |
return root; | |
}; | |
// Execute async function | |
main().then( (root) => { | |
}); | |
// Accept HMR as per: https://webpack.js.org/api/hot-module-replacement#accept | |
if (module.hot) { | |
module.hot.accept(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment