import * as path from 'path' ; import server from './server' ; module . exports = { entry : "./src/index.tsx" , output : { path : path . join ( __dirname , '/dist' ) , filename : 'bundle.js' , publicPath : '/dist/' } , devtool : "source-map" , resolve : { extensions : [ ".ts" , ".tsx" , ".js" , ".json" ] } , devServer : { historyApiFallback : true , compress : true , before : ( app ) => server ( app ) } , module : { rules : [ { test : /\.tsx?$/ , include : path . resolve ( __dirname , 'src' ) , exclude : /node_modules/ , loader : "ts-loader" } , { test : /\.css$/ , use : [ 'style-loader' , 'css-loader' ] } , { enforce : "pre" , test : /\.js$/ , loader : "source-map-loader" } ] } , } ;