initial commit
This commit is contained in:
40
webpack.config.js
Normal file
40
webpack.config.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const path = require('path');
|
||||
const nodeExternals = require('webpack-node-externals');
|
||||
|
||||
module.exports = [
|
||||
{
|
||||
name: 'main',
|
||||
target: 'node',
|
||||
mode: process.env.NODE_ENV || 'production',
|
||||
entry: './src/main.ts',
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
include: [
|
||||
path.resolve(__dirname, 'src')
|
||||
],
|
||||
exclude: [
|
||||
/node_modules/,
|
||||
],
|
||||
use: 'ts-loader'
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
modules: [
|
||||
'node_modules',
|
||||
path.resolve(__dirname, 'src')
|
||||
],
|
||||
extensions: ['.ts', '.js']
|
||||
},
|
||||
output: {
|
||||
filename: 'bundle.js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
},
|
||||
externals: [nodeExternals()],
|
||||
externalsPresets: {
|
||||
node: true
|
||||
}
|
||||
}
|
||||
];
|
||||
Reference in New Issue
Block a user