reservations_display/webpack.config.js

90 lines
1.7 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',
proxy: {
'/calendar': {
target: 'https://calendar.google.com',
changeOrigin: true,
},
'/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',
},
},
];