Open lebadapetru opened 3 years ago
It would be nice to see your Typescript config file as well. You're also using configureBabel
over configureBabelPresetEnv
, which indicates that you likely have a custom Babel config too, which would be good to see. Sure deductions can be made from the package.json
, but it's nice to see everything, even if you have to create a temporary Github repository that holds the entire project. That method in fact is the most common when actually fixing critical bugs.
A couple pointers on your general configuration:
configureImageRule
and configureFontRule
over copying files everywhere. Here's an example.package.json
, I like to keep packages that are being exported (like Bootstrap, JQuery, and Popper) under dependencies
and everything else goes under devDependencies
. This increases the overall readability. Ultimately it doesn't really matter, but we have standards on most things for just that reason.Hey @TropicalRaisel,
I'm not sure why i'm using configureBabel
over configureBabelPresetEnv
because i have no custom babel config. I believe it was the default setup at that time when i installed encore in my project.
Here's the tsconfig:
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"noImplicitThis": true,
"jsx": "preserve",
"moduleResolution": "node",
"esModuleInterop": true,
"skipLibCheck": true,
"lib": [
"esnext",
"dom",
"dom.iterable",
"scripthost"
],
"baseUrl": ".",
"paths": {
"resources/*": [
"resources/*"
]
},
//"typeRoots": [ "./types", "./node_modules/@types"]
},
/*"files": [
"shims-vue.d.ts",
],*/
"include": [
"resources/**/*.ts",
"resources/**/*.tsx",
"resources/**/*.vue",
],
"exclude": [
"node_modules",
//"types",
]
}
That was mislabeld as shims-vue.d.ts
. I'd start out by getting the recent Webpack config template, enable all Typescript compatibility, and maintain a basic Typescript config file. Slowly configure compatibility for your project and see if anything breaks, and then you may find the issue. Sometimes there can be packages that share dependencies with different versions that cause problems, so be sure to install only what you need throughout the process. I'd also try changing esnext
to es2020
, since that's the most modern and common target environment.
Adding
enableForkedTypeScriptTypesChecking
breaks the build and i can't see what i'm missing.enableTypeScriptLoader
on its own works perfectmain.ts:
webpack.config.js
shims-vue.d.ts :
package.json: