Skip to content

Commit

Permalink
Merge pull request #2946 from preactjs/react-alias
Browse files Browse the repository at this point in the history
Tests: Alias react to preact/compat
  • Loading branch information
marvinhagemeister authored Jan 20, 2021
2 parents 4581dc8 + 01b3b41 commit 33183c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 33183c8

Please sign in to comment.