const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

module.exports = {
  mode: 'production',
  entry: './packages/base/Resources/Public/Scss/main.scss',
  output: {
    path: path.resolve(__dirname, 'packages/base/Resources/Public/Css'),
    filename: 'main.js' // JS not needed, but required by Webpack. The CSS will be extracted.
  },
  module: {
    rules: [
      {
        test: /\.scss$/,
        use: [
          MiniCssExtractPlugin.loader,
          'css-loader',
          'sass-loader'
        ]
      }
    ]
  },
  plugins: [
    new MiniCssExtractPlugin({
      filename: 'main.css'
    })
  ]
};
