-
Notifications
You must be signed in to change notification settings - Fork 91
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
Typescript ES6 has problems with syntax #103
Comments
Hi @floflock declare module '*.jpg?resize'; If you want to add every possible combination, this could get quite huge.. I'll try to implement this in this package and ship those typings, but you can use this as a quickfix. |
@cyrilwanner Sadly that won't fix everything, if you combine multiple params eg. declare module '*.jpg?resize&sizes[]=500'; Meaning you would need to add every single combination you use, because |
I worked around this by adding the following TypeScript declaration: declare module '*&ts-ignore' {
const value: string;
export = value;
} And then importing images as follows:
|
@karl 's suggestion doesn't work for me. The images (modules) can't be found, only |
If I want to import an image via ES6
import
in a TypeScript file, the module cannot be found, because of missing declaration:I do declare the modules here:
But because of the query parameters, it does not work. Are there any other possibilities to give the query information to the responsive-loader?
I can use
require
, but it hat more consistency if I useimport
everywhere.I can use the default configuration, but I cannot gather a specific image size then, srcSet does work then.
Is there any solution for TypeScript?
The text was updated successfully, but these errors were encountered: