1+ var path = require ( 'path' ) ;
2+
3+ const CopyWebpackPlugin = require ( 'copy-webpack-plugin' ) ;
4+
5+ module . exports = {
6+ entry : './src/main.ts' ,
7+ target : "node" ,
8+ devtool : 'inline-source-map' ,
9+ mode : 'development' , // or 'development' if you are in dev mode
10+ output : {
11+ path : path . resolve ( __dirname , 'build' ) ,
12+ filename : 'bundle.js'
13+ } ,
14+ resolve : {
15+ extensions : [ '.ts' , '.js' ] //resolve all the modules other than index.ts
16+ } ,
17+ stats : {
18+ warnings : false
19+ } ,
20+ module : {
21+ rules : [
22+ {
23+ test : / \. t s $ / ,
24+ loader : 'ts-loader' ,
25+ options : {
26+ configFile : path . resolve ( __dirname , 'tsconfig.json' ) // Add this line to explicitly reference tsconfig.json
27+ } ,
28+ exclude : / n o d e _ m o d u l e s / ,
29+ } ,
30+ ]
31+ } ,
32+ plugins : [
33+ new CopyWebpackPlugin ( {
34+ patterns : [
35+ // { from: 'src/index.html', to: 'index.html' }, // Adjust the source path as needed
36+ // { from: 'src/swagger.json', to: 'swagger.json' }, // Adjust the source path as needed
37+ { from : 'node_modules/swagger-ui-dist/swagger-ui.css' , to : 'swagger-ui.css' } ,
38+ { from : 'node_modules/swagger-ui-dist/swagger-ui-bundle.js' , to : 'swagger-ui-bundle.js' } ,
39+ { from : 'node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js' , to : 'swagger-ui-standalone-preset.js' } ,
40+ { from : 'node_modules/swagger-ui-dist/favicon-16x16.png' , to : 'favicon-16x16.png' } ,
41+ { from : 'node_modules/swagger-ui-dist/favicon-32x32.png' , to : 'favicon-32x32.png' }
42+ ]
43+ } )
44+ ]
45+ }
0 commit comments