-
-
Save joecampo/c4aebf72a7a54a0f3c7febd363dc6106 to your computer and use it in GitHub Desktop.
Laravel Mix config for Vue 3 compat build
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
Show hidden characters
// 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"] | |
} | |
} | |
} |
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
// 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