Skip to content

Commit

Permalink
Merge pull request #3477 from preactjs/tooling-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister authored Mar 12, 2022
2 parents c1306a7 + a02f163 commit a69f287
Show file tree
Hide file tree
Showing 3 changed files with 941 additions and 925 deletions.
13 changes: 7 additions & 6 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,14 @@ function createEsbuildPlugin() {
build.onResolve({ filter: /^preact.*/ }, args => {
const pkg = alias[args.path];
return {
path: pkg,
namespace: 'preact'
path: pkg
};
});

build.onResolve({ filter: /^(react|react-dom)$/ }, args => {
const pkg = alias['preact/compat'];
return {
path: pkg,
namespace: 'preact'
path: pkg
};
});

Expand All @@ -158,7 +156,7 @@ function createEsbuildPlugin() {
loose: true,
modules: false,
targets: {
browsers: ['last 2 versions', 'IE >= 9']
browsers: ['last 2 versions', 'IE >= 11']
}
}
]
Expand All @@ -173,7 +171,7 @@ function createEsbuildPlugin() {
});

// Apply babel pass whenever we load a .js file
build.onLoad({ filter: /\.m?js$/ }, async args => {
build.onLoad({ filter: /\.[mc]?js$/ }, async args => {
const contents = await fs.readFile(args.path, 'utf-8');

// Using a cache is crucial as babel is 30x slower than esbuild
Expand Down Expand Up @@ -320,7 +318,10 @@ module.exports = function(config) {
},

esbuild: {
// karma-esbuild options
singleBundle: false,

// esbuild options
target: 'es2017',
define: {
COVERAGE: coverage,
Expand Down
Loading

0 comments on commit a69f287

Please sign in to comment.