title: Webpack-4 CSS-Loader error unknown word at module.export
body: <p>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:</p>
  
  <pre><code>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' ]
      }
  ]
  </code></pre>
  
  <p>}</p>
  
  <p>In index.js:</p>
  
  <pre><code>`import '../css/global.scss';`
  </code></pre>
  
  <p>The global.scss file consists of a list of @import statements.</p>
  
  <p>Here is the error I get:</p>
  
  <pre><code>ERROR in ./css/analytics/global.scss
  Module build failed: Unknown word (1:1)
  
  &gt; 1 | module.exports = ".custom {\n (...)
  </code></pre>
  
  <p>It seems that no matter what is on the global.scss file, the appended 'module.exports' appears to break the build.</p>
  
  <p>I have tried many suggestions on the internet but none have worked. </p>
  
  <p>Thanks in advance!</p>