I'm new at webpack and have been trying to implement it for a legacy site. No matter how many solutions I try I always get 'Unknown word' error on build using sass/raw/css/loaders. The error seems to happen at 'module.export' which is, I guess, added as a result of importing a style sheet in .js file. Here is my webpack.config.js:
module: {
rules: [
    {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
            loader: "babel-loader",
            options: { presets: ["env"] }
        }
    },
    { // sass / scss loader for webpack
        test: /\.(sass|scss)$/,
        use: [
            'css-loader',
            'raw-loader',
            'sass-loader'
        ],
        exclude: /node_modules/
    },
    {
        test: /\.(png|jpg|gif|svg)$/,
        use: [ 'file-loader' ]
    }
]
}
In index.js:
`import '../css/global.scss';`
The global.scss file consists of a list of @import statements.
Here is the error I get:
ERROR in ./css/analytics/global.scss
Module build failed: Unknown word (1:1)
> 1 | module.exports = ".custom {\n (...)
It seems that no matter what is on the global.scss file, the appended 'module.exports' appears to break the build.
I have tried many suggestions on the internet but none have worked.
Thanks in advance!