Skip to content

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

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

Closed
michael-ciniawsky opened this issue Dec 15, 2017 · 0 comments

Comments

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commented Dec 15, 2017

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
     }
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant