trying to get esBuildDecorators or esbuildPluginTsc to work with remix using this plugin
outofthisworld opened this issue · 0 comments
outofthisworld commented
I'm trying to use typeORM in a new remix project. However esbuild doesn't support emitDecoratorMeta so I'm using this plugin along with esbuildDecorators to try and get it working. For some reason however when accessing a model I'm still getting the error:
No metadata for "User" was found.
Wondering if there's anything I may be missing here.
const esbuildPluginTsc = require("esbuild-plugin-tsc");
const { esbuildDecorators } = require('@anatine/esbuild-decorators');
const { withEsbuildOverride } = require("remix-esbuild-override");
/**
* Define callbacks for the arguments of withEsbuildOverride.
* @param option - Default configuration values defined by the remix compiler
* @param isServer - True for server compilation, false for browser compilation
* @param isDev - True during development.
* @return {EsbuildOption} - You must return the updated option
*/
withEsbuildOverride((option, { isServer, isDev }) => {
// update the option
option.plugins = [...option.plugins, esbuildDecorators({tsx:true, force:true})];
//or option.plugins = [...option.plugins, esbuildPluginTsc()];
return option;
});