build icon indicating copy to clipboard operation
build copied to clipboard

Allow configuring `baseUrl` for DDC output

Open Meai opened this issue 7 years ago • 5 comments

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

Meai avatar Mar 05 '18 11:03 Meai

Maybe we just need a baseUrl configuration option which would be set for these scripts as well as the requireJs global config?

jakemac53 avatar Mar 05 '18 15:03 jakemac53

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.

ghost avatar Apr 10 '18 21:04 ghost

Just to confirm, the <base> tag support doesn't solve this issue still right?

jakemac53 avatar Apr 26 '18 15:04 jakemac53

Yes, it's a partial fix, we need a better solid fix than this.

ghost avatar Apr 26 '18 22:04 ghost

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.

ghost avatar Apr 26 '18 22:04 ghost

Closing as stale.

davidmorgan avatar Jul 07 '25 11:07 davidmorgan