Adam Goldsmith
98065af7d5
Using puppeteer to render the page server side, as FullCalendar 6 dropped support for ES5, and polyfilling everything was becoming basically impossible
90 lines
1.7 KiB
JavaScript
90 lines
1.7 KiB
JavaScript
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: {
|
|
'/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',
|
|
},
|
|
},
|
|
];
|