const path = require('path'); module.exports = (env, argv) => { const isProduction = argv.mode === 'production'; return { entry: './src/index.ts', output: { filename: 'amf.min.js', path: path.resolve(__dirname, 'dist'), }, resolve: { extensions: ['.ts', '.js'], alias: { '@': path.resolve(__dirname, 'src/'), }, }, module: { rules: [ { test: /\.ts$/, use: 'ts-loader', exclude: /node_modules/, }, { test: /\.css$/i, use: ['style-loader', 'css-loader'], }, ], }, optimization: { minimize: isProduction, }, devServer: { static: path.join(__dirname, 'dist'), compress: true, port: 8080, open: true, hot: true, }, }; };