text: const pathtoresolve = require('path');
  const paths = require('./paths')
  const { CleanWebpackPlugin } = require('clean-webpack-plugin')
  const CopyWebpackPlugin = require('copy-webpack-plugin')
  const HtmlWebpackPlugin = require('html-webpack-plugin')
  const VueLoaderPlugin = require('vue-loader/lib/plugin')
  
  module.exports = {
    entry: [ 'whatwg-fetch', paths.src + '/main.js'],
    resolve: {
      extensions: [ '.js', '.vue' ],
      alias: {
        'components': pathtoresolve.resolve(__dirname, '../src/components/'),
        'images': pathtoresolve.resolve(__dirname, '../src/images/'),
        'styles': pathtoresolve.resolve(__dirname, '../src/styles/'),
      }
    },
    output: {
      path: paths.build,
      filename: '[name].bundle.js',
      publicPath: '/',
    },
    plugins: [
      new VueLoaderPlugin(),
      new CleanWebpackPlugin(),
      new CopyWebpackPlugin({
        patterns: [
          {
            from: paths.public,
            to: 'assets',
            globOptions: {
              ignore: ['*.DS_Store'],
            },
          },
        ],
      }),
      new HtmlWebpackPlugin({
        title: 'webpack Boilerplate',
        favicon: paths.src + '/images/favicon.png',
        template: paths.src + '/template.html',
        filename: 'index.html',
      }),
    ],
    module: {
      rules: [
  	    { test: /\.vue$/, loader: 'vue-loader' },
        { test: /\.js$/, exclude: /node_modules/, use: ['babel-loader'] },
        {
          test: /\.(scss|css)$/,
          use: [
  		      'style-loader',
            { loader: 'css-loader', options: { sourceMap: true, importLoaders: 1 } },
            { loader: 'postcss-loader', options: { sourceMap: true } },
            { loader: 'sass-loader', options: { sourceMap: true } },
          ],
        },
        { test: /\.(?:ico|gif|png|jpg|jpeg)$/i, type: 'asset/resource' },
        { test: /\.(woff(2)?|eot|ttf|otf|svg|)$/, type: 'asset/inline' },
        {
          test: /\.(mov|webm|mp4)$/,
          use: [
            { loader: 'file-loader',  options: { name: '[name].[ext]' } }
          ]
        }
      ],
    },
  }
  