//@ts-check

'use strict';

import { fileURLToPath } from 'url';
import { resolve, dirname } from 'path';
import TerserPlugin from "terser-webpack-plugin";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

//@ts-check
/** @typedef {import('webpack').Configuration} WebpackConfig **/
/** @type WebpackConfig */
const config =  {
  target: [
    'web'
  ],
  mode: 'development',
  devtool: 'source-map',

  experiments: {
    outputModule: true,
  },

  entry: resolve(__dirname, './hooks.js'),
  output: {
    path: resolve(__dirname, '../.out'),
    filename: 'hooks.min.js',
    library: {
      type: "module"
    },
  },
  optimization: {
    minimize: false,
    minimizer: [new TerserPlugin()],
  },
};
export default [ config ];