TypeScript declarations outputted to src folder, is this as expected? #291
-
Not sure if this is a bug or a feature, so putting it in a discussion first. A while ago I contributed the image loading (in the webpack config) and today I finally found time to include that in my own projects as well (and thus removing all the existing code I wrote), however, it didn't work since the TypeScript declarations for the images in this file are only included in a project upon creation (when creating a new project, everything works). I would expect those declarations somewhere hidden inside a package, since now it will never be updated once a newer version is released (basically what happened when the image declarations where added, if you had created your project before that, you only have the "html" declaration in there). For me this is confusing, loading images was added, but it isn't going to work without manual changes in every application. So is this intended, or should it be fixed somehow? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The benefit of it being in the user's project is that they can modify it without forking / patching webpack-config-single-spa-ts, which can be quite nice. One of the design goals of create-single-spa was to try to make it easier to modify configuration without the hassle of ejection or some kind of tool similar to react-app-rewired or craco. So with that in mind it makes sense to keep the file in the user's project. The downside is exactly what you pointed out, though, of the files not being automatically maintained / updated. So it's just a tradeoff - hard to say which one is better than the other. |
Beta Was this translation helpful? Give feedback.
The benefit of it being in the user's project is that they can modify it without forking / patching webpack-config-single-spa-ts, which can be quite nice. One of the design goals of create-single-spa was to try to make it easier to modify configuration without the hassle of ejection or some kind of tool similar to react-app-rewired or craco. So with that in mind it makes sense to keep the file in the user's project.
The downside is exactly what you pointed out, though, of the files not being automatically maintained / updated.
So it's just a tradeoff - hard to say which one is better than the other.