amd-optimize icon indicating copy to clipboard operation
amd-optimize copied to clipboard

Allow remote scripts as dependency

Open ghost opened this issue 10 years ago • 3 comments

In one of projects, we are required to use some third-party trackers, like google analytics. With requirejs it is just possible to provide a config file aliasing them to some dependency in paths. That forces us to use full requirejs instead of almond because frequent changes in remote trackers could fail anything. WIth amd-optimize, however, it fails when the remote script is in config.

I propose to replace aliases with full uri's from config and leave them to requirejs to handle.

ghost avatar Jun 02 '15 13:06 ghost

I am very sorry, but I am a bit confused about this. Could you include a code snippet to help me understand? If you'd like to implement the changes yourself, feel free to submit a PR. I'd be happy to review them.

normanrz avatar Jun 11 '15 12:06 normanrz

I mean you can just require google analytics with requirejs like this var analytics = require('//www.google-analytics.com/analytics.js');’ or define it inpaths` config, but you can't download it to use with almond, because amd-optimize does not support remote scripts.

ghost avatar Jun 14 '15 16:06 ghost

maybe it could help http://requirejs.org/docs/optimization.html#empty

zeakd avatar Aug 20 '15 07:08 zeakd