I am trying to import my app.scss into my application.vue but I keep getting the error that the alias sass is not recognized. I looked online on how to add the alias to my mix file and I have the following webpack.mix.js. In my vue component I have the following code
<style lang="scss">
@import 'sass/app.scss';
html, body{
margin: 0px;
padding: 0px;
background-color: $secondary-color;
}
</style>
And in my webpack.mix.js
const mix = require('laravel-mix');
mix.webpackConfig({
resolve: {
alias: {
'@': path.resolve(__dirname,'/resources/js'),
'sass': path.resolve(__dirname, '/resources/assets/sass')
},
},
});
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
I tried changing the alias to ~
but that did not work. What am I doing wrong here?
<style lang="scss" scoped>
I have@import "./assets/scss/mixin";
. When callingyarn serve
I get the errorSyntax Error: SassError: Can't find stylesheet to import
showing the path@import "./assets/scss/mixin";
. I'm using vue cli. – Famous