mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
working client & server
This commit is contained in:
1 parent
cff746aa38
commit
845d4acd3a
13 files changed
+4008
-4
No files matched your search
@@ -0,0 +1,75 @@
|
||||
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];
|
||||
Reference in new issue
Block a user