text: /* eslint import/no-extraneous-dependencies: "off" */
  
  const webpack = require('webpack');
  
  const library = 'cspaceUIPluginThemeSample';
  const isProduction = process.env.NODE_ENV === 'production';
  const filename = `${library}${isProduction ? '.min' : ''}.js`;
  
  const config = {
    entry: './src/index.js',
    output: {
      filename,
      library,
      libraryTarget: 'umd',
      path: 'dist',
    },
    module: {
      loaders: [
        {
          test: /\.(js|jsx)$/,
          exclude: /node_modules/,
          loader: 'babel',
        },
        {
          test: /\.css$/,
          loader: 'style-loader!css-loader?modules&localIdentName=[folder]-[name]--[local]',
        },
        {
          test: /\.(png|jpg|svg)$/,
          loader: 'url-loader',
        },
      ],
    },
    plugins: [
      new webpack.optimize.OccurrenceOrderPlugin(),
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
      }),
    ],
    resolve: {
      extensions: ['', '.js', '.jsx'],
    },
  };
  
  if (isProduction) {
    config.plugins.push(
      new webpack.optimize.UglifyJsPlugin()
    );
  }
  
  module.exports = config;
  