Closed chelseaSchmidt closed 3 months ago
Looks fantastic! :tada: :tada: :tada:
And I got to learn about *.d.ts files, so thanks for that :) There's a very similar concept in python. The significance is pretty much exactly what you said - provide types to typescript for an un-typed file. So webpack converts image -> untyped javascript, and the d.ts
file explains to typescript what the types exported from those modules are.
And I got to learn about *.d.ts files, so thanks for that :) There's a very similar concept in python. The significance is pretty much exactly what you said - provide types to typescript for an un-typed file. So webpack converts image -> untyped javascript, and the
d.ts
file explains to typescript what the types exported from those modules are.
Nice! Aaah so that's what webpack is doing, think I get it now!
Added an
asset/resource
rule to webpack enabling loading images, which makes an import of the image file return the post-bundled image file pathAdded
images.d.ts
to tell TS that any import from the/images
directory should be considered a string, to work with the above changeDo the images show up when you run it? Also does this change look funky to you? I haven't created a
.d.ts
file before and I don't really understand the significance, just couldn't figure out another way to make Typescript and Webpack play nice ðŸ˜