Files
Yiqun/worker/webpack.config.mjs
2025-05-05 22:51:21 -03:00

40 lines
708 B
JavaScript

import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default {
mode: "development",
entry: "./src/index.ts",
output: {
filename: "main.js",
path: path.resolve(__dirname, "dist"),
libraryTarget: "commonjs2",
clean: true,
},
target: "node",
resolve: {
extensions: [".ts", ".js"],
},
module: {
rules: [
{
test: /\.ts$/,
use: {
loader: "ts-loader",
options: {
transpileOnly: true,
},
},
exclude: /node_modules/,
},
],
},
plugins: [],
devtool: "source-map",
};