-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added supports resolving aliases from `webpack.resolve.plugins`, #6 - update packages
- Loading branch information
Showing
37 changed files
with
339 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
## Install | ||
npm install | ||
``` | ||
npm i | ||
``` | ||
|
||
## Start local app in browser | ||
## Start the app in browser for local development | ||
``` | ||
npm run start | ||
> !!! currently not work !!! | ||
> | ||
> Bugfix in progress... | ||
``` | ||
|
||
## Build | ||
``` | ||
npm run build | ||
``` | ||
|
||
## Watch | ||
``` | ||
npm run watch | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
const plugin = 'directory-resolve-plugin'; | ||
|
||
//// pipeline //// | ||
// The list of event names. | ||
|
||
// resolve | ||
// internal-resolve | ||
// new-interal-resolve | ||
// parsed-resolve | ||
// described-resolve | ||
// internal | ||
// raw-module | ||
// module | ||
// resolve-as-module | ||
// undescribed-resolve-in-package | ||
// resolve-in-package | ||
// resolve-in-existing-directory | ||
// relative | ||
// described-relative | ||
// directory | ||
// undescribed-existing-directory | ||
// existing-directory | ||
// undescribed-raw-file | ||
// raw-file | ||
// file | ||
// final-file | ||
// existing-file | ||
// resolved | ||
|
||
// The source is start pipeline: use the prefix `before` or `after` with pipeline, e.g. `before-resolve`. | ||
// The Target is one of pipeline list. | ||
|
||
class DirectoryResolvePlugin { | ||
/** | ||
* | ||
* @param {string} source The source is the name of the event that starts the pipeline. | ||
* Use the prefix `before` or `after` with event name, e.g. `before-resolve`. | ||
* @param {string} target The target is the event name what should fire. | ||
*/ | ||
constructor(source, target) { | ||
this.source = source; | ||
this.target = target; | ||
} | ||
|
||
apply(resolver) { | ||
const target = resolver.ensureHook(this.target); | ||
//console.log('\n** [directory-resolve-plugin] target: ', target); | ||
|
||
resolver.getHook(this.source).tapAsync(plugin, (request, resolveContext, callback) => { | ||
let message = null; | ||
//console.log('\n** [directory-resolve-plugin] request: ', request, resolveContext); | ||
//console.log('\n** [directory-resolve-plugin]\n: ', resolveContext.stack); | ||
|
||
// Any logic you need to create a new `request` can go here | ||
resolver.doResolve(target, request, message, resolveContext, callback); | ||
}); | ||
} | ||
} | ||
|
||
module.exports = DirectoryResolvePlugin; |
Oops, something went wrong.