Skip to content

Instantly share code, notes, and snippets.

@jakedohm
Created May 21, 2020 16:33
Show Gist options
  • Save jakedohm/1d792d0e02cdaaa9deb9044a4e715de9 to your computer and use it in GitHub Desktop.
Save jakedohm/1d792d0e02cdaaa9deb9044a4e715de9 to your computer and use it in GitHub Desktop.
// 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