Closed siakaramalegos closed 4 years ago
Same issue here.
webpack 4.27.1 html-loader 0.5.5
under Windows 10
I'm using this webpack cofing:
{
test: /\.html$/,
use: {
loader: 'html-loader',
options: {
interpolate: true,
attrs: ['img:src', ':srcset']
}
}
}
Feel free to send a PR
@siakaramalegos you can npm install from PR that already has support for requested feature
Any update on this? It looks like a PR was opened, but hasn't been addressed yet.
Same issue here. srcset images are not loaded @coursar, current version were install using npm i webpack (versions are: "webpack": "^4.39.2", "webpack-cli": "^3.3.6", "webpack-dev-server": "^3.8.0") Using on Linux.
Do I use the PR version like the following?
npm install webpack/webpack.git#pull/
Am I wrong somewhere.
Same issue here.
webpack 4.27.1 html-loader 0.5.5
under Windows 10
I'm using this webpack cofing:
{ test: /\.html$/, use: { loader: 'html-loader', options: { interpolate: true, attrs: ['img:src', ':srcset'] } } }
No help. Will throw an Error: Can`t resolve './images/300_sofa_pug.jpg.webp 300w, ./images/600_sofa_pug.jpg.webp 600w' Because html-loader will not parse the srcset syntax.
Same issue here. srcset images are not loaded @coursar, current version were install using npm i webpack (versions are: "webpack": "^4.39.2", "webpack-cli": "^3.3.6", "webpack-dev-server": "^3.8.0") Using on Linux.
Do I use the PR version like the following? npm install webpack/webpack.git#pull//head
Am I wrong somewhere.
Docs: https://docs.npmjs.com/files/package.json#git-urls-as-dependencies
Sample: npm i -D git+https://github.com/webpack-contrib/html-loader#pull/192/head
Use it with caution: it's unmaintained
I've been using html-loader-srcset
instead https://www.npmjs.com/package/html-loader-srcset
I'm submitting a bug report I'm submitting a feature request
I feel like this is a bug since
srcset
is valid HTML, but I kept both bug and feature request depending on how you want to handle it.Webpack version: 4.20.2
HTML-Loader version: 0.5.5
Please tell us about your environment: OSX 10.12.6
Current behavior: Source HTML like the following:
Builds to:
and only the file listed in
src
is loaded byhtml-loader
and processed (by other loaders).Expected/desired behavior: It should require the image files listed in
srcset
so the build file would look something like this:And all files listed in
srcset
are loaded byhtml-loader
for processing (by another loader). I just put in fake hashes for illustrative purposes.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem along with a gist/jsbin of your webpack configuration. See above code sample - just put it in an HTML file.
What is the expected behavior? see above
What is the motivation / use case for changing the behavior? To load files used in valid HTML attributes.
Browser: all
Language: HTML