text: const path = require('path');
  const webpack = require('webpack');
  const MiniCssExtractPlugin = require("mini-css-extract-plugin");
  const MinifyPlugin = require("babel-minify-webpack-plugin");
  const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
  
  const nodeEnv = process.env.NODE_ENV || 'development';
  const isDev = (nodeEnv !== 'production');
  
  const config = {
    mode: nodeEnv,
    optimization: {
      minimizer: [
        new OptimizeCSSAssetsPlugin({})
      ]
    },
    plugins: [
      new MinifyPlugin({}, {
        sourceMap: isDev
      }),
      new MiniCssExtractPlugin({
        filename: 'in4lms.css'
      })
    ],
    entry: {
      dist: './src/entries/in4lms.js',
    },
    output: {
      filename: 'in4lms.js',
      path: path.resolve(__dirname, 'dist'),
    },
    module: {
      rules: [
        {
          test: /\.js/,
          loader: 'babel-loader',
          query: {
            presets: ['@babel/env']
          }
        },
        {
          test: /\.css$/,
          use: [
            MiniCssExtractPlugin.loader,
            'css-loader'
          ],
        },
        {
          test: /\.(scss)$/,
          use: [{
            loader: 'style-loader', // inject CSS to page
          }, {
            loader: 'css-loader', // translates CSS into CommonJS modules
          }, {
            loader: 'postcss-loader', // Run post css actions
            options: {
              plugins: function () { // post css plugins, can be exported to postcss.config.js
                return [
                  require('precss'),
                  require('autoprefixer')
                ];
              }
            }
          }, {
            loader: 'sass-loader' // compiles Sass to CSS
          }]
        },
        {
          test: /\.svg$/,
          use: [{
            loader: 'url-loader',
            options: {
              limit: false,
            },
          }
          ],
        }
      ]
    },
    stats: {
      colors: true
    },
  };
  
  module.exports = config;
  