Initial commit

This commit is contained in:
forceoranj
2021-10-16 01:53:56 +02:00
commit ebdd8dccdd
104 changed files with 29770 additions and 0 deletions

35
webpack/server.config.ts Normal file
View File

@@ -0,0 +1,35 @@
import path from "path"
import webpack, { Configuration } from "webpack"
import nodeExternals from "webpack-node-externals"
import merge from "webpack-merge"
import baseConfig, { isDev } from "./base.config"
const config: Configuration = {
target: "node",
devtool: isDev ? "inline-source-map" : "source-map",
entry: "./src/server",
output: {
filename: "index.js",
chunkFilename: "[id].js",
path: path.resolve(process.cwd(), "public/server"),
libraryTarget: "commonjs2",
},
node: { __dirname: true, __filename: true },
externals: [
"@loadable/component",
nodeExternals({
// Load non-javascript files with extensions, presumably via loaders
allowlist: [/\.(?!(?:jsx?|json)$).{1,5}$/i],
}),
],
plugins: [
// Adding source map support to node.js (for stack traces)
new webpack.BannerPlugin({
banner: 'require("source-map-support").install();',
raw: true,
}),
],
}
export default merge(baseConfig(false), config)