Browserify-shim使用谷歌作为依赖

时间:2015-06-30 23:09:26

标签: javascript google-maps browserify browserify-shim

我使用google viz中的几个库。

  1. 谷歌地图
  2. 谷歌拾取器
  3. google client api for authentication
  4. 我想使用browserify-shim来填充L.Google

    "browserify-shim": {
    "google": "global:google",
    "L.Google": {
      "depends": [
        "leaflet:L",
        "google"
      ]
    }
    ...
    }
    

    我收到此错误:

     Error: Cannot find module 'google' from 'C:\Users\lenovo\Downloads\Browserify\Br
    owserify\js\leaflet-plugins'
        at C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_modules\
    resolve\lib\async.js:46:17
        at process (C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node
    _modules\resolve\lib\async.js:173:43)
        at ondir (C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_m
    odules\resolve\lib\async.js:188:17)
        at load (C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_mo
    dules\resolve\lib\async.js:69:43)
        at onex (C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_mo
    dules\resolve\lib\async.js:92:31)
        at C:\Users\lenovo\AppData\Roaming\npm\node_modules\browserify\node_modules\
    resolve\lib\async.js:22:47
        at FSReqWrap.oncomplete (fs.js:95:15)
    

0 个答案:

没有答案