Remove the File not found or not accessible
tracing warning and declare runtime only modules
#802
Labels
File not found or not accessible
tracing warning and declare runtime only modules
#802
I'm submitting a feature request
0.32.0
Please tell us about your environment:
Operating System:
All
Node Version:
7.10.0
NPM Version:
4.2.0
Browser:
all
Language:
all
Loader/bundler:
all
Current behavior:
When a module is only available at deploy/run time the builder reports something like:
This report is very useful to detect missing files or dependencies, but in some cases, for known dependencies, this behavior requires a way to be overridden.
On my side what I need is an entrypoint inside the
aurelia.json
where I can specify a list of modules to stub with some related dependencies.It could be something like:
where
my-awesome-module
is the missing file reported by the build andinfrastructure/service1
andother
are some dependencies of the declared module that must exists inside this build.So, if the previous configuration is applied and the following report is displayed, I can regard it as a build issue.
After some investigation on your code I found that this can be solved intercepting the
amodro-trace
dependency tracking using thereadFile
function parameter passed to the trace call. Here you can inject some custom content formy-awesome-module
likedefine(['infrastructure/service1', 'other'], function() {})
.The hook, adapted from the
Non-file inputs
section of theamodro-trace
documentation example, can be something like:If you are interested on this and the possible solution listed above is acceptable I can provide a PR in the next days.
There are mostly 2 use cases that needs this, and are:
define
methodThe text was updated successfully, but these errors were encountered: