0

I am getting error while compiling my scss file using webpack. I am currently using webpack v4. Webpack shows

Module parse failed: Unexpected token (1:4)
You may need an appropriate loader to handle this file type.

Error. help me to fix this issue. here is my project structure , error and package,json

enter image description here

This is the directory structure.

enter image description here

My package.json file

enter image description here

The Error while running webpack

webpack.config.js

const path = require('path');
const ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
  entry:path.resolve(__dirname,'resources/assets/js/entry.js'),
  output:{
    path:path.resolve(__dirname,'public/js'),
    filename:'script.bundle.js'
  },
  module:{
    rules:[{
      test: /\.(s*)css$/,
      use:ExtractTextPlugin.extract({
        fallback:'style-loader',
        use:[{
              loader:"css-loader",
              options:{
                url:false
              }
            },
            {
              loader:"sass-loader"
            }]
      })
    }]
  },
  plugins:[
    new ExtractTextPlugin('style.css'),
  ]
}

enter image description here

Ru Chern Chong
  • 3,692
  • 13
  • 33
  • 43
Chandra Shekhar
  • 3,550
  • 2
  • 14
  • 22

0 Answers0