From fcfbdb44477c6ed063a22a9ce3b972698479da3b Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Fri, 1 Apr 2022 17:42:55 -0700 Subject: [PATCH] fix: Apply correct ordering to esbuild-register --- index.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/index.js b/index.js index 310f9e8..90f0e6d 100644 --- a/index.js +++ b/index.js @@ -146,15 +146,6 @@ var extensions = { 'typescript-register', 'typescript-require', 'sucrase/register/ts', - { - module: 'esbuild-register/dist/node', - register: function(mod) { - mod.register({ - extensions: ['.ts'], - target: 'node' + process.version.slice(1), - }); - }, - }, { module: '@babel/register', register: function(hook) { @@ -165,20 +156,20 @@ var extensions = { }); }, }, - ], - '.tsx': [ - 'ts-node/register', - 'typescript-node/register', - 'sucrase/register', { module: 'esbuild-register/dist/node', register: function(mod) { mod.register({ - extensions: ['.tsx'], + extensions: ['.ts'], target: 'node' + process.version.slice(1), }); }, }, + ], + '.tsx': [ + 'ts-node/register', + 'typescript-node/register', + 'sucrase/register', { module: '@babel/register', register: function(hook) { @@ -189,6 +180,15 @@ var extensions = { }); }, }, + { + module: 'esbuild-register/dist/node', + register: function(mod) { + mod.register({ + extensions: ['.tsx'], + target: 'node' + process.version.slice(1), + }); + }, + }, ], '.wisp': 'wisp/engine/node', '.xml': 'require-xml',