text: const webpack = require('webpack');
  const path = require('path');
  const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
  //const CleanWebpackPlugin = require('clean-webpack-plugin');
  
  module.exports = {
  	plugins: [
  		//new CleanWebpackPlugin(["dist"])
  	],
  	module: {
  		rules: [
        {
          test: /\.tag$/,
          exclude: /node_modules/,
          use: [{
            loader: 'riot-tag-loader',
            options: {
              hot: false, // set it to true if you are using hmr
              // add here all the other riot-compiler options riot.js.org/guide/compiler/
              // template: 'pug' for example
            }
          }]
        },
  			{
  				test: /\.js$/,
  				include: [path.resolve(__dirname, 'src')],
  				use: {
            loader: 'babel-loader',
            options: {
  						plugins: ['syntax-dynamic-import'],
              presets: ['@babel/preset-env']
            }
  				},
  			},
  			{
  				test: /\.(scss|css)$/,
  
  				use: [
  					{
  						loader: 'style-loader'
  					},
  					{
  						loader: 'css-loader'
  					},
  					{
  						loader: 'sass-loader'
  					}
  				]
  			}
  		]
  	},
  
  	entry: {
  		app: './src/app.js'
  	},
  
  	output: {
  		filename: '[name].js',
  		path: path.resolve(__dirname, 'dist/js')
  	},
  
  	mode: 'development',
  
  	optimization: {
  		splitChunks: {
  			cacheGroups: {
  				vendors: {
  					priority: -10,
  					test: /[\\/]node_modules[\\/]/
  				}
  			},
  
  			chunks: 'async',
  			minChunks: 1,
  			minSize: 30000,
  			name: true
  		}
  	}
  };
  