// Autogenerated by Mojo::Alien::webpack 1.01
const fs = require('fs');
const pkg = require('./package.json');
const path = require('path');

const assetsDir = process.env.WEBPACK_ASSETS_DIR || path.resolve(__dirname, 'assets');
const isDev = process.env.NODE_ENV !== 'production';

const config = {
  entry: {},
  mode: isDev ? 'development' : 'production',
  module: {rules: []},
  optimization: {minimizer: []},
  output: {},
  plugins: [],
};

config.output.filename = isDev ? '[name].development.js' : '[name].[chunkhash].js';
config.output.path = process.env.WEBPACK_OUT_DIR || path.resolve(__dirname, 'dist');
config.output.publicPath = '';

const entry = path.resolve(assetsDir, 'index.js');
if (fs.existsSync(entry)) config.entry[pkg.name.replace(/\W+/g, '-')] = entry;

const includeFile = path.resolve(assetsDir, 'webpack.config.d', 'include.js');
if (fs.existsSync(includeFile)) require(includeFile)(config, {isDev});

// Legacy
const custom = path.resolve(assetsDir, 'webpack.custom.js');
if (fs.existsSync(custom)) require(custom)(config);

module.exports = config;
