forked from Redocly/redocly-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
57 lines (51 loc) · 1.22 KB
/
webpack.config.ts
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
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: './packages/cli/src/index.ts',
mode: 'production',
module: {
rules: [
{
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
},
],
exclude: /node_modules/,
},
{
// we use bundling for online processing only, so no need for websockets
// which are used only in preview-docs command.
// on the other hand it was impossible to bundle this lib into a package
test: path.resolve(__dirname, 'node_modules/simple-websocket/server.js'),
use: 'null-loader',
},
{
test: path.resolve(__dirname, 'node_modules/fsevents/fsevents.node'),
use: 'null-loader',
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
mainFields: ['main'],
fallback: {
fs: false,
},
},
node: {
__dirname: false,
},
plugins: [new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true })],
optimization: {
splitChunks: {
minChunks: Infinity,
},
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
},
target: 'node',
};