Skip to content

[v1.0.0-alpha (Feature)] support custom URL filters (options.import|options.url)  #158

@michael-ciniawsky

Description

@michael-ciniawsky

Feature

html-loader should support filtering URL paths

1. {Regex}

Ignores URLs matching the exclude patttern

webpack.config.js

{
   loader: `html-loader`
   options: {
      url: /dirname/,
      import: /dirname/
   }
}

2. {Function}

Ignores URLs based on a custom filter {Function} returning a {Boolean} value

webpack.config.js

{
   loader: `html-loader`
   options: {
      url (url) {
         return url.includes('dirname') : true : false
      },
      import (url) {
         return url.includes('dirname') : true : false
     }
   }
}

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions