laravel8 vue3 scss を読み込めない
vue3をやっていたら scss を読み込めない。
laravel を使って vue3 をやる場合は少し特殊なのか?
/resources/css/app.scss
body {
background-color: pink !important;
}
vue.blade.php
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
webpack.min.js
const mix = require('laravel-mix');
/*
|--------------------------------------------------------------------------
| Mix Asset Management
|--------------------------------------------------------------------------
|
| Mix provides a clean, fluent API for defining some Webpack build steps
| for your Laravel applications. By default, we are compiling the CSS
| file for the application as well as bundling up all the JS files.
|
*/
//ここのsass ってのが重要
mix.js('resources/js/app.js', 'public/js').vue().version()
.sass('resources/css/app.scss', 'public/css', [
]);
ちなみに
npm run prod をするとcssもjsも自動で圧縮される。
以上
Author And Source
この問題について(laravel8 vue3 scss を読み込めない), 我々は、より多くの情報をここで見つけました https://qiita.com/ma7ma7pipipi/items/ced54cbbce277abd1b05著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .