-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
32 lines (31 loc) · 908 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
32
const nodeExternals = require('webpack-node-externals');
const path = require('path');
module.exports = {
mode: 'development',
devtool: 'inline-source-map',
entry: './src/tool/uml/Uml',
target: 'node',
externals: [nodeExternals()],
externalsPresets: {node: true},
output: {filename: 'bundle.js'},
resolve: {
alias: {
src: path.resolve(__dirname, './src'),
},
roots: [path.resolve(__dirname)],
// Add `.ts` and `.tsx` as a resolvable extension.
extensions: ['.ts', '.tsx', '.js'],
// Add support for TypeScripts fully qualified ESM imports.
extensionAlias: {
'.js': ['.js', '.ts'],
'.cjs': ['.cjs', '.cts'],
'.mjs': ['.mjs', '.mts'],
},
},
module: {
rules: [
// all files with a `.ts`, `.cts`, `.mts` or `.tsx` extension will be handled by `ts-loader`
{test: /\.([cm]?ts|tsx)$/, loader: 'ts-loader'},
],
},
};