forked from Tpessia/ssr-proxy-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
31 lines (30 loc) · 863 Bytes
/
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
const path = require('path');
const pkg = require('./package.json');
const nodeExternals = require('webpack-node-externals');
module.exports = {
// mode: 'production',
target: 'node', // in order to ignore built-in modules like path, fs, etc.
entry: path.resolve(__dirname, 'src/index.ts'),
module: {
rules: [{
test: /\.ts$/,
include: /src/,
use: [{
loader: 'ts-loader' ,
options: { configFile: 'tsconfig.json' },
}],
}],
},
resolve: {
extensions: ['.ts', '.js'],
},
output: {
library: pkg.name,
libraryTarget: 'umd',
filename: 'index.js',
path: path.resolve(__dirname, 'dist'),
},
externals: [
nodeExternals(), // in order to ignore all modules in node_modules folder
],
};