Skip to content

Instantly share code, notes, and snippets.

@joecampo
Forked from thecrypticace/tsconfig.json
Created August 12, 2021 18:16
Show Gist options
  • Save joecampo/c4aebf72a7a54a0f3c7febd363dc6106 to your computer and use it in GitHub Desktop.
Save joecampo/c4aebf72a7a54a0f3c7febd363dc6106 to your computer and use it in GitHub Desktop.
Laravel Mix config for Vue 3 compat build
// If you're using typescript or ts-check you can alias the composition api package as well:
{
"compilerOptions": {
// … other stuff omitted for brevity …
// Ensure your base url is set
"baseUrl": ".",
"paths": {
// Add composition API to your compiler options and alias it to the vue 3 install
// The path is relative to `baseUrl` above
"@vue/composition-api": ["node_moudules/vue/dist/vue"]
}
}
}
// Tell Mix to use Vue 3 and the appropriate compat options when compiling .vue files
mix.vue({
version: 3,
options: {
compilerOptions: {
compatConfig: {
MODE: 3,
},
},
},
})
// Alias Vue and (optionally) the composition API
mix.webpackConfig(() => {
return {
resolve: {
alias: {
vue: "@vue/compat",
"@vue/composition-api": "@vue/compat",
}
},
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment