text: const path = require('path');
  const webpack = require('webpack');
  const { VueLoaderPlugin } = require('vue-loader');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  
  module.exports = (env = {}) => ({
    mode: env.prod ? 'production' : 'development',
    devtool: env.prod ? 'source-map' : 'eval-cheap-module-source-map',
    entry: [
      path.resolve(__dirname, './assets/scripts/firefly.js'),
      path.resolve(__dirname, './assets/styles/firefly.scss')
    ],
    watch: !env.prod,
    output: {
      path: path.resolve(__dirname, './assets'),
      filename: 'firefly.min.js',
      publicPath: '/assets/'
    },
    resolve: {
      alias: {
        '@': path.resolve(__dirname, 'assets/scripts'),
      }
    },
    module: {
      rules: [
        {
          test: /\.vue$/,
          use: 'vue-loader'
        },
        {
          test: /\.png$/,
          use: {
            loader: 'url-loader',
            options: { limit: 8192 }
          }
        },
        {
          test: /\.css$/,
          use: [
            {
              loader: MiniCssExtractPlugin.loader
            },
            'css-loader'
          ]
        },
        {
          test: /\.scss$/,
          use: [
            {
              loader: 'file-loader',
              options: {
                name: 'firefly.min.css',
              }
            },
            {
              loader: 'extract-loader'
            },
            {
              loader: 'css-loader?-url'
            },
            {
              loader: 'postcss-loader'
            },
            {
              loader: 'sass-loader'
            }
          ]
        }
      ]
    },
    plugins: [
      new VueLoaderPlugin(),
      new MiniCssExtractPlugin({
        filename: 'firefly.css'
      }),
      new webpack.DefinePlugin({
        __VUE_OPTIONS_API__: 'true',
        __VUE_PROD_DEVTOOLS__: 'false'
      })
    ],
    watchOptions: {
      ignored: ['node_modules/**']
    }
  })
  