2020-06-30 19:36:15 +00:00
|
|
|
const path = require('path');
|
|
|
|
const nodeExternals = require('webpack-node-externals');
|
|
|
|
|
2021-05-12 06:35:00 +00:00
|
|
|
/** @type { import('webpack').Configuration } */
|
2020-06-30 19:36:15 +00:00
|
|
|
module.exports = {
|
2021-05-12 06:35:00 +00:00
|
|
|
entry: './src/index.ts',
|
2020-06-30 19:36:15 +00:00
|
|
|
target: 'node',
|
|
|
|
output: {
|
2020-07-07 00:31:48 +00:00
|
|
|
path: path.resolve(__dirname, '..', 'dist'),
|
2021-05-12 06:35:00 +00:00
|
|
|
filename: 'index.js',
|
2020-06-30 19:36:15 +00:00
|
|
|
library: 'insomniacli',
|
|
|
|
libraryTarget: 'commonjs2',
|
|
|
|
},
|
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
2021-05-12 06:35:00 +00:00
|
|
|
test: /\.tsx?$/,
|
|
|
|
loader: 'ts-loader',
|
2020-06-30 19:36:15 +00:00
|
|
|
exclude: [/node_modules/],
|
2021-05-12 06:35:00 +00:00
|
|
|
options: {
|
|
|
|
configFile: 'tsconfig.build.json',
|
2020-06-30 19:36:15 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-05-12 06:35:00 +00:00
|
|
|
resolve: {
|
|
|
|
extensions: ['.js', '.ts'],
|
|
|
|
},
|
|
|
|
externals: [
|
|
|
|
'node-libcurl',
|
|
|
|
'mocha',
|
|
|
|
nodeExternals(),
|
|
|
|
],
|
2020-06-30 19:36:15 +00:00
|
|
|
};
|