Module build error when running Vuetify with Sass

Viewed 770

I am using Webpack with Vuetify and I get a SASS error when compiling. My webpack config file is:


'use strict'

const path = require('path');
const { VueLoaderPlugin } = require("vue-loader");

module.exports = {
  mode: 'development',
  entry: './index.js',
  output: {
    filename: 'app.js',
    path: path.resolve(__dirname, 'js'),
  },
  module: {
    rules: [
      { test: /\.vue$/, use: 'vue-loader' },
      {
        test: /\.(scss|sass|css)/,
        use: [
          'vue-style-loader',
          'css-loader',
          {
            loader: 'sass-loader',
            // Requires sass-loader@^7.0.0
            // options: {
            //   implementation: require('sass'),
            //   fiber: require('fibers'),
            //   indentedSyntax: true // optional
            // },
            // Requires sass-loader@^8.0.0
            options: {
              implementation: require('sass'),
              sassOptions: {
                fiber: require('fibers'),
                indentedSyntax: true // optional
              },
            },
          },
        ],
      }
    ]
  },
  plugins: [new VueLoaderPlugin()]
};

The error I receive when building is:

ERROR in ./node_modules/vuetify/dist/vuetify.min.css (./node_modules/css-loader/dist/cjs.js!./node_modules/sass-loader/dist/cjs.js??ref--1-2!./node_modules/vuetify/dist/vuetify.min.css)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Expected newline.
  ╷
1 │ @charset "UTF-8";
  │                 ^

I'm convinced I must be missing some setting in the options for the style loaders somewhere, but I don't know what. Can anyone see where I'm going wrong?

0 Answers
Related