- Install required dependencies
yarn add vue@^3.0 @vue/compiler-sfc@^3.0 vue-loader@^16
vue
and @vue/compiler-sfc
versions must be same.
- Update your
webpack.config.js
like:
module.exports = require('laravel-bundler')({
entry: {
app: './resources/js/index.js',
}
},
require('laravel-bundler/src/recipes/vue-3.js')
);
- Your styles from
*.vue
SFC will be extracted and merged with the mainapp.css
. - You can use css or sass within Vue SFC, if you want other pre-processor support; you need to configure them manually.