aboutsummaryrefslogtreecommitdiff
path: root/webpack.worker.config.js
blob: f2a2da1999941559d6031f9b9fdec4fd9ef41ad4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// webpack.worker.config.js
// eslint-disable-next-line @typescript-eslint/no-require-imports
const path = require('path');

module.exports = {
    mode: 'development',
    entry: './src/workers/image.worker.ts', // 👈 Adjust path to your worker file
    output: {
        filename: 'image.worker.js',
        publicPath: '/',
        path: path.resolve(__dirname, 'build'),
    },
    experiments: {
        outputModule: true,
    },
    resolve: {
        extensions: ['.ts', '.js'],
    },
    module: {
        rules: [
            {
                test: /\.ts$/,
                loader: 'ts-loader',
                options: {
                    configFile: 'tsconfig.worker.json',
                },
            },
        ],
    },
};