Skip to content

How to disable resolving of empty srcset attribute #20

Closed Answered by webdiscus
hqw567 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @hqw567,

thanks for the question.

I can't think of a use case with empty srcset attribute.
Yes, defaults behaviour throws an exception, this is right. An empty srcset attribute means you forgot to define the source file, otherwise what's the reason of having an empty attribute?

If you need to disable the srcset attribute or ignore an empty value, use the loader option sources:

Disable the processing of an attribute

const HtmlBundlerPlugin = require('html-bundler-webpack-plugin');
module.exports = {
  plugins: [
    new HtmlBundlerPlugin({
      entry: {
        index: 'src/views/index.html',
      },
      loaderOptions: {
        sources: [
          // disable the processing of at…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by hqw567
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #16 on June 21, 2023 11:50.