0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

laravel8 vue3 scss を読み込めない

Last updated at Posted at 2021-12-27

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も自動で圧縮される。

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?