text: const path = require('path');
  const webpack = require('webpack');
  const GitRevisionPlugin = require('git-revision-webpack-plugin');
  const gitRevisionPlugin = new GitRevisionPlugin();
  const autoprefixer = require('autoprefixer');
  const cssnano = require('cssnano');
  
  module.exports = {
      mode: 'development',
  
      devtool: 'cheap-module-source-map',
  
      entry: {
          DPlayer: './src/js/index.js',
      },
  
      output: {
          path: path.resolve(__dirname, '..', 'dist'),
          filename: '[name].js',
          library: '[name]',
          libraryTarget: 'umd',
          libraryExport: 'default',
          umdNamedDefine: true,
          publicPath: '/',
      },
  
      resolve: {
          modules: ['node_modules'],
          extensions: ['.js', '.scss'],
      },
  
      module: {
          strictExportPresence: true,
          rules: [
              {
                  test: /\.js$/,
                  use: [
                      {
                          loader: 'babel-loader',
                          options: {
                              cacheDirectory: true,
                              presets: ['@babel/preset-env'],
                          },
                      },
                  ],
              },
              {
                  test: /\.scss$/,
                  use: [
                      'style-loader',
                      {
                          loader: 'css-loader',
                          options: {
                              importLoaders: 1,
                          },
                      },
                      {
                          loader: 'postcss-loader',
                          options: {
                              plugins: [autoprefixer, cssnano],
                          },
                      },
                      'sass-loader',
                  ],
              },
              {
                  test: /\.(png|jpg)$/,
                  loader: 'url-loader',
                  options: {
                      limit: 40000,
                  },
              },
              {
                  test: /\.svg$/,
                  use: [
                      {
                          loader: 'svg-inline-loader'
                      }
                  ]
              },
              {
                  test: /\.art$/,
                  use: [
                      {
                          loader: 'art-template-loader'
                      }
                  ]
              },
          ],
      },
  
      devServer: {
          compress: true,
          contentBase: path.resolve(__dirname, '..', 'demo'),
          clientLogLevel: 'none',
          quiet: false,
          open: true,
          historyApiFallback: {
              disableDotRule: true,
          },
          watchOptions: {
              ignored: /node_modules/,
          },
      },
  
      plugins: [
          new webpack.DefinePlugin({
              DPLAYER_VERSION: `"${require('../package.json').version}"`,
              GIT_HASH: JSON.stringify(gitRevisionPlugin.version()),
          }),
      ],
  
      node: {
          dgram: 'empty',
          fs: 'empty',
          net: 'empty',
          tls: 'empty',
      },
  
      performance: {
          hints: false,
      },
  };
  