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 = { 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 ( { allowlist : [ /\.(?!(?:jsx?|json)$).{1,5}$/i ] , } ) , ] , plugins : [ new webpack . BannerPlugin ( { banner : 'require("source-map-support").install();' , raw : true , } ) , ] , } ; export default merge ( baseConfig ( false ) , config ) ;