0

I am using the goog plugin for requirejs like this:

define(['underscore', 'backbone', 'marionette', 'goog!visualization,1,packages:[geomap]'],
function(_, Backbone, Marionette) {
        ...
});

The code works fine until I build the project using grunt (grunt build). When I run the built code, I get Uncaught ReferenceError: google is not defined error. My Gruntfile.js includes this:

requirejs: {
  build: {
    options: {
      baseUrl: "js/",
      optimizeCss: 'none',
      mainConfigFile: "js/app.js",
      name: "../bower_components/almond/almond",
      out: "build/js/app-built.js",
      include: ["app"]
    }
  }
},

I tried adding the pluging to the include part but no luck. Is there a way to fix it?

AliBZ
  • 4,039
  • 12
  • 45
  • 67

1 Answers1

0

Have you tried including the goog javascript file in the requirejs configuration? My configurations has the following in the requirejs configuration and it works.

require({
  paths : {
    goog : 'bower_components/src/goog.js'
  }
}); 
erik-e
  • 3,721
  • 1
  • 21
  • 19