Open RyannGalea opened 3 years ago
Hi, same question here! Is this plugin ready for consumption? The checkmark in the readme seems to indicate so, but I don't think it is yet? At least it doesn't seem to work out of the box for me. A little help would be greatly appreciated 😉
@acidoxee I resorted to using 'tsc-alias' & babel, couldn't get esbuild to work with my Typescript project.
The tsconfig-paths
plugin also seems to do nothing for me out of the box. Is this plugin working for anyone else?
Managed to get it working as follows:
const esbuild = require('esbuild');
const {TsconfigPathsPlugin} = require('@esbuild-plugins/tsconfig-paths');
esbuild
.serve(
{servedir: 'public', port: 3000},
{
bundle: true,
outfile: 'public/js/app.js',
entryPoints: ['./src/index.tsx'],
minify: true,
define: {
global: 'window',
},
inject: ['./esbuild/react-shim.js'],
plugins: [TsconfigPathsPlugin({tsconfig: './tsconfig.json'})],
},
)
.catch((err) => console.log(err));
{
"compilerOptions": {
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"baseUrl": "./",
"paths": {
"@/*": ["./src/*"]
}
},
"include": ["src"]
}
The default export coming from @esbuild-plugins/tsconfig-paths
doesn't seem to work.
@rickklaasboer I had the same problem and your solution solved it. Thank you.
Really trying to solve an issue with resolving paths when building with esbuild and it seems this project will do that? At some point, not sure how to use it in its current form?