-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
80 lines (77 loc) · 2.84 KB
/
webpack.config.js
File metadata and controls
80 lines (77 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
var path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: './src/main.ts',
target: "node",
devtool: 'inline-source-map',
mode: 'development', // or 'development' if you are in dev mode
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'main.js'
},
resolve: {
alias: {
src: path.resolve(__dirname, 'src')
},
extensions: ['.ts', '.js', '.json']
},
stats: {
warnings: false
},
module: {
rules: [
{
test: /\.ts$/,
loader: 'ts-loader',
options: {
configFile: path.resolve(__dirname, 'tsconfig.json') // Add this line to explicitly reference tsconfig.json
},
exclude: /node_modules/,
},
]
},
plugins: [
new CopyWebpackPlugin({
patterns: [
// { from: 'src/index.html', to: 'index.html' }, // Adjust the source path as needed
// { from: 'src/swagger.json', to: 'swagger.json' }, // Adjust the source path as needed
{ from: 'node_modules/swagger-ui-dist/swagger-ui.css', to: 'swagger-ui.css' },
{ from: 'node_modules/swagger-ui-dist/swagger-ui-bundle.js', to: 'swagger-ui-bundle.js' },
{ from: 'node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js', to: 'swagger-ui-standalone-preset.js' },
{ from: 'node_modules/swagger-ui-dist/favicon-16x16.png', to: 'favicon-16x16.png' },
{ from: 'node_modules/swagger-ui-dist/favicon-32x32.png', to: 'favicon-32x32.png' }
]
}),
new CopyWebpackPlugin({
patterns: [
{
from: 'node_modules/swagger-ui-dist',
to: 'public/docs',
globOptions: {
ignore: ['**/index.html']
}
},
{
from: 'node_modules/swagger-ui-dist/swagger-ui.css',
to: 'docs/swagger-ui.css',
},
{
from: 'node_modules/swagger-ui-dist/swagger-ui-bundle.js',
to: 'docs/swagger-ui-bundle.js',
},
{
from: 'node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js',
to: 'docs/swagger-ui-standalone-preset.js',
},
{
from: 'node_modules/swagger-ui-dist/favicon-16x16.png',
to: 'docs/favicon-16x16.png',
},
{
from: 'node_modules/swagger-ui-dist/favicon-32x32.png',
to: 'docs/favicon-32x32.png',
},
]
})
]
}