text: 'use strict';
  
  const webpack = require('webpack');
  const path = require('path');
  const TerserPlugin = require('terser-webpack-plugin');
  
  const nonMinimizeTrait = {
    optimization: {
      minimize: false,
      usedExports: false,
      concatenateModules: false,
    },
  };
  
  const minimizeTrait = {
    plugins: [
      new webpack.LoaderOptionsPlugin({
        minimize: true,
      }),
    ],
    optimization: {
      minimizer: [
        new TerserPlugin({
          terserOptions: {
            compress: {
              warnings: false,
            },
            output: {
              comments: false,
            },
          },
        }),
      ],
    },
  };
  
  const ra = {
    mode: 'production',
    entry: './src/index.js',
    target: 'node',
    output: {
      path: path.resolve('./dist'),
      filename: 'node.js',
      libraryTarget: 'umd',
      libraryExport: 'default',
      library: 'JsonApiMerge',
    },
    externals: {
      ramda: 'ramda',
      'ramda-adjunct': 'ramda-adjunct',
    },
    module: {
      rules: [
        {
          test: /\.(js)$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
          options: {
            presets: [
              [
                '@babel/preset-env',
                {
                  targets: {
                    node: '4',
                  },
                  forceAllTransforms: true,
                },
              ],
            ],
            plugins: [
              [
                '@babel/plugin-transform-modules-commonjs',
                {
                  loose: true,
                },
              ],
            ],
          },
        },
      ],
    },
    ...nonMinimizeTrait,
  };
  
  const raMin = {
    mode: 'production',
    entry: './src/index.js',
    target: 'node',
    output: {
      path: path.resolve('./dist'),
      filename: 'node.min.js',
      libraryTarget: 'umd',
      libraryExport: 'default',
      library: 'JsonApiMerge',
    },
    externals: {
      ramda: 'ramda',
      'ramda-adjunct': 'ramda-adjunct',
    },
    module: {
      rules: [
        {
          test: /\.(js)$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
          options: {
            presets: [
              [
                '@babel/preset-env',
                {
                  targets: {
                    node: '4',
                  },
                  forceAllTransforms: true,
                },
              ],
            ],
            plugins: [
              [
                '@babel/plugin-transform-modules-commonjs',
                {
                  loose: true,
                },
              ],
            ],
          },
        },
      ],
    },
    ...minimizeTrait,
  };
  
  const raWeb = {
    mode: 'production',
    entry: './src/index.js',
    target: 'web',
    output: {
      path: path.resolve('./dist'),
      filename: 'web.js',
      libraryTarget: 'umd',
      libraryExport: 'default',
      library: 'JsonApiMerge',
    },
    externals: {
      ramda: 'R',
      'ramda-adjunct': 'RA',
    },
    module: {
      rules: [
        {
          test: /\.(js)$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
          options: {
            presets: [
              [
                '@babel/preset-env',
                {
                  forceAllTransforms: true,
                },
              ],
            ],
            plugins: [
              [
                '@babel/plugin-transform-modules-commonjs',
                {
                  loose: true,
                },
              ],
            ],
          },
        },
      ],
    },
    ...nonMinimizeTrait,
  };
  
  const raWebMin = {
    mode: 'production',
    entry: './src/index.js',
    target: 'web',
    output: {
      path: path.resolve('./dist'),
      filename: 'web.min.js',
      libraryTarget: 'umd',
      libraryExport: 'default',
      library: 'JsonApiMerge',
    },
    externals: {
      ramda: 'R',
      'ramda-adjunct': 'RA',
    },
    module: {
      rules: [
        {
          test: /\.(js)$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
          options: {
            presets: [
              [
                '@babel/preset-env',
                {
                  forceAllTransforms: true,
                },
              ],
            ],
            plugins: [
              [
                '@babel/plugin-transform-modules-commonjs',
                {
                  loose: true,
                },
              ],
            ],
          },
        },
      ],
    },
    ...minimizeTrait,
  };
  
  const raWebStandalone = {
    mode: 'production',
    entry: './src/index.js',
    target: 'web',
    output: {
      path: path.resolve('./dist'),
      filename: 'web.standalone.js',
      libraryTarget: 'umd',
      libraryExport: 'default',
      library: 'JsonApiMerge',
    },
    module: {
      rules: [
        {
          test: /\.(js)$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
          options: {
            presets: [
              [
                '@babel/preset-env',
                {
                  forceAllTransforms: true,
                },
              ],
            ],
            plugins: [
              [
                '@babel/plugin-transform-modules-commonjs',
                {
                  loose: true,
                },
              ],
            ],
          },
        },
      ],
    },
    ...nonMinimizeTrait,
  };
  
  const rawWebStandaloneMin = {
    mode: 'production',
    entry: './src/index.js',
    target: 'web',
    output: {
      path: path.resolve('./dist'),
      filename: 'web.standalone.min.js',
      libraryTarget: 'umd',
      libraryExport: 'default',
      library: 'JsonApiMerge',
    },
    module: {
      rules: [
        {
          test: /\.(js)$/,
          exclude: /node_modules/,
          loader: 'babel-loader',
          options: {
            presets: [
              [
                '@babel/preset-env',
                {
                  forceAllTransforms: true,
                },
              ],
            ],
            plugins: [
              [
                '@babel/plugin-transform-modules-commonjs',
                {
                  loose: true,
                },
              ],
            ],
          },
        },
      ],
    },
    ...minimizeTrait,
  };
  
  module.exports = [
    ra,
    raMin,
    raWeb,
    raWebMin,
    raWebStandalone,
    rawWebStandaloneMin,
  ];
  