Open Meai opened 6 years ago
Maybe we just need a baseUrl
configuration option which would be set for these scripts as well as the requireJs global config?
When a chrome extensions injects a content script into browser that references other dart files then nothing works because DDC is referencing incorrect URLs, so developer is forced to use dart2js
.
But, developing chrome extensions with dart2js
is slow as compared to DDC.
While using dart2js When a global dart file is edited then almost entire source code have to be recompiled.
Setting a custom baseUrl
for applications will ease the development process.
Just to confirm, the <base>
tag support doesn't solve this issue still right?
Yes, it's a partial fix, we need a better solid fix than this.
For now I keep a local copy of edited build scripts. Also note that sourcemaps don't work for scripts loaded using DDC with a different baseUrl.
The real solution would be to provide a way to configure base url for sourcemaps + DDC + service worker etc.
For content scripts, the baseUrl is going to be whatever page you are on and so it will never find all these extra scripts that it's trying to load:
https://reddit.com/packages/$sdk/dev_compiler/amd/require.js net::ERR_ABORTED https://reddit.com/packages/$sdk/dev_compiler/web/dart_stack_trace_mapper.js net::ERR_ABORTED