Files
papercrate/frontend/webpack.config.js
T
nils be451bda1e
ci / docker (backend, backend/Dockerfile, backend) (push) Failing after 14s
ci / docker (frontend, frontend/Dockerfile, frontend) (push) Failing after 13s
dev: switch to fully containerized Docker Compose workflow
- Replace tmux setup with a full Docker Compose development stack
- Update backend Dockerfile to use `cargo-chef` caching and `supervisord`
- Containerize frontend development server
- Update tests to run in isolated containers
- Remove legacy `papercrate.tmux`
2025-12-17 19:55:47 +01:00

79 lines
1.7 KiB
JavaScript

const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './src/index.tsx',
output: {
filename: 'bundle.[contenthash].js',
path: path.resolve(__dirname, 'dist'),
clean: true,
},
module: {
rules: [
{
test: /\.[jt]sx?$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
{
test: /\.css$/i,
use: ['style-loader', 'css-loader'],
},
{
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
use: ['@svgr/webpack'],
},
{
test: /\.svg$/i,
type: 'asset/resource',
issuer: { not: [/\.[jt]sx?$/] },
},
],
},
plugins: [
new HtmlWebpackPlugin({
template: path.resolve(__dirname, 'src/index.html'),
favicon: false,
}),
new CopyWebpackPlugin({
patterns: [
{
from: path.resolve(__dirname, 'node_modules/pdfjs-dist/wasm'),
to: 'pdfjs/wasm',
},
],
}),
],
devServer: {
static: [
{
directory: path.join(__dirname, 'public'),
},
{
directory: path.resolve(__dirname, 'node_modules/pdfjs-dist/wasm'),
publicPath: '/pdfjs/wasm',
watch: false,
},
],
compress: true,
port: 5173,
historyApiFallback: true,
open: true,
proxy: [
{
context: ['/api', '/download'],
target: process.env.API_PROXY_PASS,
changeOrigin: true,
secure: false,
},
],
},
devtool: 'source-map',
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
};