reservations_display/webpack.config.js

92 lines
1.8 KiB
JavaScript
Raw Normal View History

const path = require('path');
const common = {
mode: 'development',
module: {
rules: [
{
test: /\.(png|jpg|gif|svg|eot|ttf|woff)$/,
type: 'asset/resource',
},
{
test: /\.css$/i,
2022-03-10 23:38:38 -05:00
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',
2024-03-22 13:28:42 -04:00
proxy: [
{
context: ['/calendar'],
target: 'https://calendar.google.com',
changeOrigin: true,
},
2024-03-22 13:28:42 -04:00
{
context: ['/ipad.png'],
target: 'http://localhost:1234',
},
2024-03-22 13:28:42 -04:00
],
},
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',
},
},
];