reservations_display/webpack.config.js

82 lines
1.5 KiB
JavaScript
Raw Normal View History

const path = require('path');
const common = {
mode: 'development',
module: {
rules: [
{
test: /\.css$/i,
2022-03-10 23:38:38 -05:00
use: ['style-loader', 'css-loader'],
},
{
test: /\.html$/i,
use: {
2022-03-10 23:38:38 -05:00
loader: 'file-loader',
options: {
name: '[name].[ext]',
2022-03-10 23:38:38 -05:00
},
},
},
],
},
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',
},
},
];