mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 14:49:53 +00:00
5f4c19da35
Co-authored-by: Opender Singh <opender.singh@konghq.com>
36 lines
895 B
JavaScript
36 lines
895 B
JavaScript
const path = require('path');
|
|
|
|
/** @type { import('webpack').Configuration } */
|
|
module.exports = {
|
|
entry: { index: './src/index.ts' },
|
|
target: 'node',
|
|
mode: 'production',
|
|
devtool: 'source-map',
|
|
output: {
|
|
path: path.resolve(__dirname, 'dist'),
|
|
filename: '[name].js',
|
|
library: 'insomniatesting',
|
|
libraryTarget: 'commonjs2',
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.tsx?$/,
|
|
loader: 'ts-loader',
|
|
exclude: [/node_modules/],
|
|
options: {
|
|
configFile: 'tsconfig.build.json',
|
|
},
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: ['.ts', '.js'],
|
|
},
|
|
externals: [
|
|
// Don't bundle Mocha because it needs to use require() to load tests.
|
|
// If it's bundled in the Webpack build, it will try to use Webpack's require() function and fail to import the test file because it lives outside the bundle.
|
|
'mocha',
|
|
],
|
|
};
|