forked from emyann/prisma-uml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.ts
30 lines (27 loc) · 1.02 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
import webpack from 'webpack'
import path from 'path'
import nodeExternals from 'webpack-node-externals'
import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin'
//const nodeEnv = process.env.NODE_ENV || 'development';
//const isProd = nodeEnv === 'production';
delete process.env.TS_NODE_PROJECT
const webpackconfiguration: webpack.Configuration = {
entry: path.resolve(__dirname, 'src', 'index.ts'),
target: 'node',
externals: [nodeExternals()],
output: {
filename: 'prisma-uml.js',
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'commonjs',
sourceMapFilename: 'prisma-uml.map',
},
resolve: {
extensions: ['.ts', '.js', '.json'],
plugins: [new TsconfigPathsPlugin({ configFile: path.resolve(__dirname, 'tsconfig.prod.json') })],
},
module: {
rules: [{ test: /\.(ts|js)x?$/, use: ['babel-loader', 'source-map-loader'], exclude: /node_modules/ }],
},
plugins: [new webpack.BannerPlugin({ banner: '#!/usr/bin/env node', raw: true })],
}
export default webpackconfiguration