const path = require('path'); const common = { mode: 'development', module: { rules: [ { test: /\.(png|jpg|gif|svg|eot|ttf|woff)$/, type: 'asset/resource', }, { test: /\.css$/i, use: ['style-loader', 'css-loader'], }, { test: /\.html$/i, type: 'asset/resource', generator: { filename: '[name][ext]', }, }, ], }, devtool: 'source-map', resolve: { extensions: ['.tsx', '.ts', '.js'], }, }; module.exports = [ { ...common, name: 'default', entry: { index: './src/index.ts', 'wall-display': './src/wall-display.ts', }, devServer: { allowedHosts: 'all', proxy: [ { context: ['/calendar'], target: 'https://calendar.google.com', changeOrigin: true, }, { context: ['/ipad.png'], target: 'http://localhost:1234', }, ], }, module: { rules: [ { test: /\.tsx?$/, exclude: /node_modules/, use: ['ts-loader'], }, ...common.module.rules, ], }, output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle-[name].js', }, }, { ...common, name: 'ipad', entry: ['./src/ipad.ts'], module: { rules: [ { test: /\.m?js$/, include: /node_modules\/@fullcalendar/, loader: 'babel-loader', }, { test: /\.tsx?$/, exclude: /node_modules/, use: ['babel-loader', 'ts-loader'], }, ...common.module.rules, ], }, output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle-ipad.js', }, }, ];