mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 14:38:46 +00:00
76 lines
1.5 KiB
JavaScript
76 lines
1.5 KiB
JavaScript
const webpack = require("webpack");
|
|
const path = require("path");
|
|
const RemovePlugin = require("remove-files-webpack-plugin");
|
|
|
|
const buildPath = path.resolve(__dirname, "dist");
|
|
|
|
const server = {
|
|
entry: "./server/server.ts",
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: ["ts-loader"],
|
|
exclude: /node_modules/,
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new webpack.DefinePlugin({ "global.GENTLY": false }),
|
|
new RemovePlugin({
|
|
before: {
|
|
include: [path.resolve(buildPath, "server")],
|
|
},
|
|
watch: {
|
|
include: [path.resolve(buildPath, "server")],
|
|
},
|
|
}),
|
|
],
|
|
optimization: {
|
|
minimize: true,
|
|
},
|
|
resolve: {
|
|
extensions: [".tsx", ".ts", ".js"],
|
|
},
|
|
output: {
|
|
filename: "[contenthash].server.js",
|
|
path: path.resolve(buildPath, "server"),
|
|
},
|
|
target: "node",
|
|
};
|
|
|
|
const client = {
|
|
entry: "./client/client.ts",
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
use: ["ts-loader"],
|
|
exclude: /node_modules/,
|
|
},
|
|
],
|
|
},
|
|
plugins: [
|
|
new RemovePlugin({
|
|
before: {
|
|
include: [path.resolve(buildPath, "client")],
|
|
},
|
|
watch: {
|
|
include: [path.resolve(buildPath, "client")],
|
|
},
|
|
}),
|
|
],
|
|
optimization: {
|
|
minimize: true,
|
|
},
|
|
resolve: {
|
|
extensions: [".tsx", ".ts", ".js"],
|
|
},
|
|
output: {
|
|
filename: "[contenthash].client.js",
|
|
path: path.resolve(buildPath, "client"),
|
|
},
|
|
};
|
|
|
|
module.exports = [server, client];
|