-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
41 lines (37 loc) · 1.23 KB
/
webpack.config.js
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
const project = require('./package.json')
const path = require('path')
const NodemonPlugin = require('nodemon-webpack-plugin')
const nodeExternals = require('webpack-node-externals')
const CopyPlugin = require("copy-webpack-plugin");
const SwaggerJSDocWebpackPlugin = require('swagger-jsdoc-webpack-plugin');
const pathToSwaggerUi = require('swagger-ui-dist').absolutePath()
module.exports = {
entry: './bin/www.js',
output: {
filename: 'index.js',
path: path.resolve(__dirname, 'dist')
},
target: 'node',
externals: [nodeExternals()],
plugins: [
new NodemonPlugin(),
new CopyPlugin({
patterns: [
{ from: "src/views", to: "views" },
{ from: "src/public", to: "public" },
{ from: path.resolve(__dirname, pathToSwaggerUi), to: "api-docs" },
],
}),
new SwaggerJSDocWebpackPlugin({
swaggerDefinition: {
openapi: '3.0.0',
info: {
title: 'Pokemon API',
version: project.version,
description: project.description,
},
},
apis: ['./src/routes/**/*.js'],
}),
]
}