{"size": 1569, "ext": "js", "max_stars_repo_path": "config/webpack.config.publish.js", "max_stars_repo_name": "codeparticle/react-sidenav", "max_stars_repo_stars_event_min_datetime": "2019-04-30T17:48:58.000Z", "max_stars_repo_stars_event_max_datetime": "2019-08-21T16:24:38.000Z", "max_issues_repo_path": "config/webpack.config.publish.js", "max_issues_repo_name": "codeparticle/react-sidenav", "max_issues_repo_issues_event_min_datetime": "2019-08-12T16:11:23.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-28T13:43:33.000Z", "max_forks_repo_path": "config/webpack.config.publish.js", "max_forks_repo_name": "codeparticle/react-sidenav", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 12, "max_issues_count": 140, "max_forks_count": null, "avg_line_length": 23.0735294118, "max_line_length": 114, "alphanum_fraction": 0.5691523263}
const CopyPkgJsonPlugin = require('copy-pkg-json-webpack-plugin');
const autoprefixer = require('autoprefixer');
const merge = require('webpack-merge');
const nodeExternals = require('webpack-node-externals');
const baseConfig = require('./webpack.config.base');
const paths = require('./paths');

const CSSLoader = {
  loader: 'css-loader',
  options: {
    modules: false,
  },
};

const postCSSLoader = {
  loader: 'postcss-loader',
  options: {
    postcssOptions: {
      ident: 'postcss',
      sourceMap: true,
      plugins: () => [
        autoprefixer({
          browsers: ['>1%', 'last 4 versions', 'Firefox ESR', 'not ie < 9'],
        }),
      ],
    }
  },
};

const publishConfig = {
  entry: paths.appIndexJs,
  externals: [nodeExternals()],
  output: {
    // The build folder.
    path: paths.appBuild,
    filename: 'index.js',
    library: '@codeparticle/react-sidenav',
    libraryTarget: 'umd',
    umdNamedDefine: true,
  },
  module: {
    rules: [
      {
        test: /\.scss$/,
        exclude: /\.module\.scss$/,
        use: ['style-loader', CSSLoader, postCSSLoader, 'sass-loader'],
      },
      {
        test: /\.(js|jsx)$/,
        loader: require.resolve('babel-loader'),
        options: {
          compact: true,
        },
      },
    ],
  },
  plugins: [
    new CopyPkgJsonPlugin({
      remove: ['private', 'devDependencies', 'dependencies', 'scripts', 'husky', 'jest', 'babel', 'eslintConfig'],
      replace: {
        main: 'index.js',
      },
    }),
  ],
};

module.exports = merge.smart(baseConfig, publishConfig);
