[Vuejs]-Laravel Webpack mix.js Cannot Compile with extenstion .vue

0👍

If i am not mistaken you can’t compile single .vue files using webpack without some sort of loader

Using Vue.component() and importing a vue file into a .js file and then compiling the .js will work.

This might be of help: https://github.com/vuejs/vue-loader

Vue Single-File Component (SFC) Spec
A *.vue file is a custom file format that uses HTML-like syntax to
describe a Vue component. Each *.vue file consists of three types of
top-level language blocks: , , and , and
optionally additional custom blocks:

vue-loader will parse the file, extract each language block, pipe them
through other loaders if necessary, and finally assemble them back
into an ES Module whose default export is a Vue.js component options
object.

Leave a comment