Skip to content
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

TS support #7

Open
Seriesr94 opened this issue Nov 3, 2022 · 0 comments
Open

TS support #7

Seriesr94 opened this issue Nov 3, 2022 · 0 comments

Comments

@Seriesr94
Copy link

is there any way to pass a tsconfig.json to resolve in webpack?
to prevent this error
Error: ENOENT: no such file or directory, stat 'tsconfig.json' at Object.statSync (node:fs:1551:3) at resolveConfigPath (/home/seriesr/WebstormProjects/untitled/node_modules/tsconfig-paths/lib/tsconfig-loader.js:56:12) at loadSyncDefault (/home/seriesr/WebstormProjects/untitled/node_modules/tsconfig-paths/lib/tsconfig-loader.js:33:22) at tsConfigLoader (/home/seriesr/WebstormProjects/untitled/node_modules/tsconfig-paths/lib/tsconfig-loader.js:27:22) at configLoader (/home/seriesr/WebstormProjects/untitled/node_modules/tsconfig-paths/lib/config-loader.js:28:22) at Object.loadConfig (/home/seriesr/WebstormProjects/untitled/node_modules/tsconfig-paths/lib/config-loader.js:8:12) at new TsconfigPathsPlugin (/home/seriesr/WebstormProjects/untitled/node_modules/tsconfig-paths-webpack-plugin/lib/plugin.js:33:40) at file:///home/seriesr/WebstormProjects/untitled/index.js:74:23 at ModuleJob.run (node:internal/modules/esm/module_job:198:25) at async Promise.all (index 0) { errno: -2, syscall: 'stat', code: 'ENOENT', path: 'tsconfig.json'

my code:
const code = await webpackCompile({ webpack, config: { mode: 'development', target: 'web', output:{ path: '/' }, module: { rules: [ { test: /\.(ts|tsx)$/i, loader: "ts-loader", exclude: ["/node_modules/"], }, { test: /\.(eot|svg|ttf|woff|woff2|png|jpg|gif)$/i, type: "asset", }, ], }, resolve: { extensions: [".tsx", ".ts", ".jsx", ".js", "..."], plugins: [new TsconfigPathsPlugin({ configFile: 'tsconfig.json', baseUrl: './', extensions: [".tsx", ".ts", ".jsx", ".js", "..."], })], }, plugins: [...] }, code: fileContent, })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant