Files
tlsn-js/webpack.build.config.js
tsukino 079f1a314c chore: add unit test using puppeteer (#12)
* chore: add unit test using puppeteer

* chore: add package-lock

* chore: add package-lock

* fix: temporary workaround for issue in time crate

* experimenting with tests

* chore: make testRunner more modular

* feat: add simple-verify test

* chore: add test to github action

---------

Co-authored-by: Hendrik Eeckhaut <hendrik@eeckhaut.org>
2024-02-08 21:45:31 -05:00

59 lines
1.1 KiB
JavaScript

const webpack = require('webpack');
const path = require('path');
const isProd = process.env.NODE_ENV === 'production';
const envPlugin = new webpack.EnvironmentPlugin({
NODE_ENV: 'development',
});
const rules = [
{
test: /\.tsx?$/,
exclude: [/(node_modules|.webpack)/],
rules: [
{
loader: 'ts-loader',
options: {
configFile: 'tsconfig.json',
transpileOnly: true,
},
},
],
},
{
test: /\.node$/,
use: 'node-loader',
},
];
module.exports = [
{
mode: isProd ? 'production' : 'development',
entry: {
index: path.join(__dirname, 'src', 'index.ts'),
},
target: 'web',
devtool: 'source-map',
resolve: {
extensions: ['.ts', '.js'],
},
node: {
__dirname: true,
},
module: {
rules: [...rules],
},
output: {
publicPath: '',
path: __dirname + '/build',
filename: `[name].js`,
libraryTarget: 'umd',
globalObject: 'this',
umdNamedDefine: true,
},
plugins: [
envPlugin,
],
},
];