Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Support resolveLoader.alias #55

Open
mhuggins opened this issue Dec 7, 2017 · 1 comment
Open

Support resolveLoader.alias #55

mhuggins opened this issue Dec 7, 2017 · 1 comment

Comments

@mhuggins
Copy link

mhuggins commented Dec 7, 2017

I'm trying to change a resolver for a test. Specifically, I have a file being required via "worker-loader?inline=true!pdfjs-dist/build/pdf\.worker", and I would like my test suite to treat it as "raw-loader!pdfjs-dist/build/pdf\.worker".

I tried to abuse the current setup like so:

resolve: {
  alias: {
    "worker-loader\\?inline=true!pdfjs-dist/build/pdf\\.worker": path.resolve(__dirname, "node_modules/pdfjs-dist/build/pdf.worker.js")
  }
}

Unfortunately, that simply prefixes the import with "./", changing it into "./worker-loader?inline=true!pdfjs-dist/build/pdf\.worker".

@mhuggins
Copy link
Author

mhuggins commented Dec 7, 2017

Also a minor thing, but if a filename has a "." in it, your regexp match will treat that as any character instead of a period.

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

No branches or pull requests

1 participant