insomnia/packages/insomnia-inso/webpack/webpack.config.base.js
Dimitri Mitropoulos 5f4c19da35
[TypeScript] Phase 1 & 2 (#3370)
Co-authored-by: Opender Singh <opender.singh@konghq.com>
2021-05-12 18:35:00 +12:00

35 lines
698 B
JavaScript

const path = require('path');
const nodeExternals = require('webpack-node-externals');
/** @type { import('webpack').Configuration } */
module.exports = {
entry: './src/index.ts',
target: 'node',
output: {
path: path.resolve(__dirname, '..', 'dist'),
filename: 'index.js',
library: 'insomniacli',
libraryTarget: 'commonjs2',
},
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: [/node_modules/],
options: {
configFile: 'tsconfig.build.json',
},
},
],
},
resolve: {
extensions: ['.js', '.ts'],
},
externals: [
'node-libcurl',
'mocha',
nodeExternals(),
],
};