You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm processing templates with html-loader so that webpack will optimize and fingerprint image files that are referenced in the template. However, I would like to be able to reference an image file within Typescript code, and have the same effect.
This works (HTML), and the image is processed by webpack: <img src="../image/img1.png">
This doesn't work (Typescript): let carouselImage = require('../images/img1.png');
The following error is output: ERROR in xxx.ts (299,22): Cannot find name 'require'.
Mention any other details that might be useful.
See issues #2231 and #3415 regarding processing of image files using webpack.
The text was updated successfully, but these errors were encountered:
Bug Report or Feature Request (mark with an
x
)Versions.
Desired functionality.
I'm processing templates with html-loader so that webpack will optimize and fingerprint image files that are referenced in the template. However, I would like to be able to reference an image file within Typescript code, and have the same effect.
This works (HTML), and the image is processed by webpack:
<img src="../image/img1.png">
This doesn't work (Typescript):
let carouselImage = require('../images/img1.png');
The following error is output:
ERROR in xxx.ts (299,22): Cannot find name 'require'.
Mention any other details that might be useful.
See issues #2231 and #3415 regarding processing of image files using webpack.
The text was updated successfully, but these errors were encountered: