-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How does '@esbuild-plugins/tsconfig-paths' work? #6
Comments
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 |
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 |
@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?
The text was updated successfully, but these errors were encountered: