Adam Goldsmith
652f78944a
This avoids `[webpack-dev-middleware] ConcurrentCompilationError` issues when running `webpack serve`. However, it prevents running the dev server for just the `wall-display` config (as it no longer has the `/calendar` proxy route defined.
82 lines
1.5 KiB
JavaScript
82 lines
1.5 KiB
JavaScript
const path = require('path');
|
|
|
|
const common = {
|
|
mode: 'development',
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.css$/i,
|
|
use: ['style-loader', 'css-loader'],
|
|
},
|
|
{
|
|
test: /\.html$/i,
|
|
use: {
|
|
loader: 'file-loader',
|
|
options: {
|
|
name: '[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',
|
|
},
|
|
},
|
|
];
|