Adam Goldsmith
084f398d41
Spinner GIF derived from https://loading.io/, using `apng2gif` to get correct transparency behavior
84 lines
1.6 KiB
JavaScript
84 lines
1.6 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: './src/index.ts',
|
|
devServer: {
|
|
allowedHosts: 'all',
|
|
proxy: {
|
|
'/calendar': {
|
|
target: 'https://calendar.google.com',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
exclude: /node_modules/,
|
|
use: ['ts-loader'],
|
|
},
|
|
...common.module.rules,
|
|
],
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'bundle.js',
|
|
},
|
|
},
|
|
{
|
|
...common,
|
|
name: 'wall-display',
|
|
entry: './src/wall-display.ts',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.m?js$/,
|
|
exclude: /node_modules/,
|
|
loader: 'babel-loader',
|
|
},
|
|
{
|
|
test: /\.tsx?$/,
|
|
exclude: /node_modules/,
|
|
use: ['babel-loader', 'ts-loader'],
|
|
},
|
|
...common.module.rules,
|
|
],
|
|
},
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: 'bundle-wall-display.js',
|
|
},
|
|
},
|
|
];
|