scalableminds / amd-optimize

An AMD (RequireJS) optimizer that's stream-friendly. Made for gulp.
MIT License
162 stars 29 forks source link

Support to stubModules #66

Open rubenspgcavalcante opened 8 years ago

rubenspgcavalcante commented 8 years ago

Hello there, I'm having a problem when using the async requirejs plugin. When optmized, the main file contains the following code

//shim requirejs config
// ...
leafletGoogleLayer: ['async!http://maps.google.com/maps/api/js', 'leaflet'],
// ...

The output:

// Tries to load (base-url)/async.js -> gives 404
define('leafletGoogleLayer', [
    'async!http://maps.google.com/maps/api/js',
    'leaflet'
], function () {
///...

But the plugin must be removed:

// Now it's correct!
define('leafletGoogleLayer', [
    'http://maps.google.com/maps/api/js',
    'leaflet'
], function () {
///...

The r.js have support to remove the plugins via stubModules config. There's a way to do it in amd-optimize?