Skip to content
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

Feature: Loaders may provide an own testing method #8

Closed
jhnns opened this issue Jul 6, 2012 · 3 comments
Closed

Feature: Loaders may provide an own testing method #8

jhnns opened this issue Jul 6, 2012 · 3 comments

Comments

@jhnns
Copy link
Member

jhnns commented Jul 6, 2012

I would appreciate it if a loader could define an own test-regexp to specify when it's called. This way a developer just has to apply the loader and don't care about the right regexp (or copy it from a readme file).

@sokra
Copy link
Member

sokra commented Jul 6, 2012

I don't understand the question :(

@jhnns
Copy link
Member Author

jhnns commented Jul 6, 2012

Mhmm maybe I got it wrong. I was looking for a possibility to write:

    resolve: {
        loaders: [require("./myLoader.js")]
    }

But this can be accomplished if myLoader exported a test- and a loader-property. Sorry for this unnecessary issue :)

@jhnns jhnns closed this as completed Jul 6, 2012
@jhnns
Copy link
Member Author

jhnns commented Jul 6, 2012

It works when myLoader.js looks like this:

function myLoader() {
    ...
}

myLoader.loader = __filename;
myLoader.test = myRegExp;

module.exports = myLoader;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants