You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 16, 2024. It is now read-only.
import { CleanWebpackPlugin } from "clean-webpack-plugin";
import dotenv from "dotenv";
import * as path from "path";
import * as webpack from "webpack";
const dotEnvConfigs = {
path: path.resolve(process.cwd(), ".env"),
};
dotenv.config(dotEnvConfigs);
const config: webpack.Configuration = {
entry: {
service_worker: "./src/worker/start.worker.ts",
},
mode: `production`,
target: "node",
output: {
path: path.resolve(__dirname, "./dist/worker"), //! plz setup outDir in tsconfig.json if you want build many file, if you don't setup it, build export =1 file
filename: "index.js",
},
devtool: "inline-source-map",
module: {
rules: [
{
test: /\.ts?$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
resolve: {
extensions: [".ts", ".js", ".tsx", ".json"],
},
optimization: {
minimize: true,
emitOnErrors: true,
mangleWasmImports: true,
removeAvailableModules: true, //? Set true when running in production
removeEmptyChunks: true,
mergeDuplicateChunks: true, //? Set true when running in production