You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 16, 2018. It is now read-only.
Repository navigation
This repository was archived by the owner on Jan 16, 2018. It is now read-only.
require.resolve in the configuration only resolve npm modules. For other packages you can pass an absolute path to the package. path.join(__dirname, "bower_modules", "myPackage") or write your own resolve function which does this for you (better readable).
Activity
sokra commentedon Feb 13, 2014
Currently loaders are matched against the resolved resource.
So you could write it less verbose with:
It may be possible to match against the resolved and non-resolved resource...
gunta commentedon Feb 14, 2014
I see.
Some questions:
require.resolveworks for npm packages, how would you resolve it easily for bower packages? Maybe by creating aresolve.anything()function?testshould match resolved, non-resolved, and aliases by default, what do you think?If the syntax becomes messy, perhaps using different keys? Something like:
For aliases:
For non-resolved resources:
However I think something more simple like being based on the parameter type like this can be easier to use:
For resolved resources, a
Regex pattern:For non-resolved resources and aliases, a plain
String:What do you think?
sokra commentedon Feb 14, 2014
require.resolvealso works for bower packages if you confiugure the resolving in your configuration to resolve them.testBeforeortestRawstrings already have a function. They match the start of the request, so you can pass an absolute path here.
sokra commentedon Feb 14, 2014
Oh I missunderstood part 1.
require.resolvein the configuration only resolve npm modules. For other packages you can pass an absolute path to the package.path.join(__dirname, "bower_modules", "myPackage")or write your ownresolvefunction which does this for you (better readable).