insomnia/packages/insomnia-testing/webpack.config.js
Gregory Schier 45861b6393
POC to get Insomnia networking available outside of app (#2329)
* Hacked insomnia lib package to get Insomnia's networking in tests

* Some small tweaks

* Got it mostly working

* Tweak

* Fix

* Fix pkg

* Fix some things

* Add comment

* Comment out log

* Some tweaks after doing a self code review

* Fix test

* Update app name for `insomnia-send-request`

* Update package-lock

* Update package-locks

* Fix tests

* Add gitignore

* Fix tests hopefully

* Fix accidental dep deletions

* Fix tests again

* Mock for all tests

* Update tests again

* Don't compile for Electron for tests

* Update release scripts to disable tests
2020-06-30 12:36:15 -07:00

33 lines
758 B
JavaScript

const path = require('path');
module.exports = {
entry: { index: './index.js' },
target: 'node',
mode: 'production',
devtool: 'source-map',
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
library: 'insomniatesting',
libraryTarget: 'commonjs2',
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
},
},
],
},
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',
],
};