2017-09-24
Make sure you have the vue$
alias in webpack.config.js:
{
resolve: {
alias: {
'vue$': 'vue/dist/vue/esm.js',
},
},
}
If you still get an error like:
You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
Make sure your vue import in your scripts is spelled - a typeo can cause Vue to still load but not use the webpack alias:
// CORRECT - lowercase 'vue'
import Vue from 'vue'
// WRONG - shoule be 'vue' not 'Vue' for from statement
import Vue from 'Vue'
Make sure that '.js'
is included in the list of extensions to resolve!
{
resolve: {
extensions: ['.js', '.ts', '.vue']
},
}