text: /* eslint-disable no-undef */
  const path = require('path');
  const webpack = require('webpack');
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
  const GitRevisionPlugin = require('git-revision-webpack-plugin');
  const gitRevisionPlugin = new GitRevisionPlugin();
  
  module.exports = {
  
      mode: 'production',
  
      bail: true,
  
      devtool: 'source-map',
  
      entry: {
          'DPlayer': './src/js/index.js'
      },
  
      output: {
          path: path.resolve(__dirname, '..', 'dist'),
          filename: '[name].min.js',
          library: '[name]',
          libraryTarget: 'umd',
          libraryExport: 'default',
          umdNamedDefine: true,
          publicPath: '/'
      },
  
      resolve: {
          modules: ['node_modules'],
          extensions: ['.js', '.scss']
      },
  
      module: {
          strictExportPresence: true,
          rules: [
              {
                  test: /\.js$/,
                  enforce: 'pre',
                  loader: 'eslint-loader',
                  include: path.resolve(__dirname, '../src/js'),
              },
              {
                  test: /\.js$/,
                  use: [
                      'template-string-optimize-loader',
                      {
                          loader: 'babel-loader',
                          options: {
                              cacheDirectory: true,
                              presets: ['@babel/preset-env']
                          }
                      }
                  ]
              },
              {
                  test: /\.scss$/,
                  use: [
                      MiniCssExtractPlugin.loader,
                      {
                          loader: 'css-loader',
                          options: {
                              importLoaders: 1,
                              sourceMap: true
                          }
                      },
                      {
                          loader: 'postcss-loader',
                          options: {
                              config: {
                                  path: path.join(__dirname, 'postcss.config.js')
                              }
                          }
                      },
                      'sass-loader',
                  ]
              },
              {
                  test: /\.(png|jpg)$/,
                  loader: 'url-loader',
                  options: {
                      'limit': 40000
                  }
              },
              {
                  test: /\.svg$/,
                  loader: 'svg-inline-loader'
              },
              {
                  test: /\.art$/,
                  loader: 'art-template-loader'
              }
          ]
      },
  
      plugins: [
          new webpack.DefinePlugin({
              DPLAYER_VERSION: `"${require('../package.json').version}"`,
              GIT_HASH: JSON.stringify(gitRevisionPlugin.version())
          }),
          new MiniCssExtractPlugin({
              filename: '[name].min.css'
          })
      ],
  
      node: {
          dgram: 'empty',
          fs: 'empty',
          net: 'empty',
          tls: 'empty',
      }
  
  };
  