const path = require ( 'path' ) ; const webpack = require ( 'webpack' ) ; module . exports = { mode : 'none' , entry : { server : './server.ts' } , externals : [ ] , target : 'node' , resolve : { extensions : [ '.js' , '.ts' ] } , optimization : { minimize : false } , output : { path : path . join ( __dirname , `functions/dist` ) , library : 'app' , libraryTarget : 'umd' , filename : '[name].js' } , resolve : { alias : { [ 'firebase/app' ] : path . resolve ( __dirname , 'node_modules/firebase/app/dist/index.cjs.js' ) } } , module : { noParse : /polyfills-.*\.js/ , rules : [ { test : /\.ts$/ , loader : 'ts-loader' , exclude : /^(?!.*\.spec\.ts$).*\.ts$/ } , { test : /(\\|\/)@angular(\\|\/)core(\\|\/).+\.js$/ , parser : { system : true } } ] } , plugins : [ new webpack . ContextReplacementPlugin ( /(.+)?angular(\\|\/)core(.+)?/ , path . join ( __dirname , 'src' ) , { } ) , new webpack . ContextReplacementPlugin ( /(.+)?express(\\|\/)(.+)?/ , path . join ( __dirname , 'src' ) , { } ) ] } ;