mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-11 13:56:29 +02:00
Initial commit
This commit is contained in:
35
webpack/server.config.ts
Normal file
35
webpack/server.config.ts
Normal 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)
|
Reference in New Issue
Block a user