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 to do TypeScript type checking in 5.1+? #2547
Comments
Update -- I think I was able to get it to work with the fork-ts-checker-webpack-plugin via this helpful issue I would recommend adding this optional step to the TypeScript install / upgrade guide to enable type checking during webpack compilation: yarn install -D fork-ts-checker-webpack-plugin then const ForkTsCheckerWebpackPlugin = require("fork-ts-checker-webpack-plugin");
const path = require("path");
environment.plugins.append(
"ForkTsCheckerWebpackPlugin",
new ForkTsCheckerWebpackPlugin({
tsconfig: path.resolve(__dirname, "../../tsconfig.json"),
async: false,
})
); |
Oh hey, I'm glad that issue is still helpful to people :D |
you meant btw no need to set tsconfig. it will select the tsconfig of the project root folder. |
Are there any specific vue instructions/flags we need to flip for this to operate in 5.1+? because the |
@snkashis I had the same issue. I found out that you need to change your For Vue 3: new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: path.resolve(__dirname, "../../tsconfig.json"),
extensions: {
vue: {
enabled: true,
compiler: '@vue/compiler-sfc'
}
}
},
async: false,
}) For Vue 2: new ForkTsCheckerWebpackPlugin({
typescript: {
configFile: path.resolve(__dirname, "../../tsconfig.json"),
extensions: {
vue: true
}
},
async: false,
}) I guess a documentation update would be nice 🤔 I had some trouble updating to Question to the maintainers: Any thoughts on this? How should a PR look? |
Hello,
I have a TypeScript project and recently followed the upgrade instructions since TS compilation is now babel instead of ts-loader.
However, I was also using
ts-loader
for type checking during the webpack compilation. In the previous setup, the compiler wouldn't succeed if there was a TypeScript error.I am wondering how can I get that functionality with the new setup?
Thank you
The text was updated successfully, but these errors were encountered: