From 31c43c89887e50c8d41dbfeee683ce408de694c7 Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Wed, 20 Jan 2021 17:58:17 +0100 Subject: [PATCH] Tests: Alias react to preact/compat --- karma.conf.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/karma.conf.js b/karma.conf.js index 20fb33247e..fb04fa0e91 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -138,6 +138,14 @@ function createEsbuildPlugin() { }; }); + build.onResolve({ filter: /^(react|react-dom)$/ }, args => { + const pkg = alias['preact/compat']; + return { + path: pkg, + namespace: 'preact' + }; + }); + // Apply babel pass whenever we load a .js file build.onLoad({ filter: /\.js$/ }, async args => { const contents = await fs.readFile(args.path, 'utf-8');