thlorenz / browserify-shim

📩 Makes CommonJS incompatible files browserifyable.
MIT License
933 stars 87 forks source link

browserify-shim export error #230

Closed muashraf closed 7 years ago

muashraf commented 7 years ago

I'm trying to make DHTLMX commonjs compatible, therefore, I'm making use of browserify. In my package.json I'm trying to expose multiple functions from dhtmlxcontainer.js file using browserify-shim transformation - I did something like following and getting error. Any help would be appreciated!


    "transform": [
      "browserify-shim"
    ]
  },
  "browser": {
    "dhtmlxcontainer": "./src/dhtmlxCommon/codebase/dhtmlxcontainer.js",      
    "dhtmlxform": "./src/dhtmlxForm/codebase/dhtmlxform.js",
    "dhtmlxlayout": "./src/dhtmlxLayout/codebase/dhtmlxlayout.js",
    "dhtmlxlist": "./src/dhtmlxList/codebase/dhtmlxlist.js",
    "dhtmlxmessage": "./src/dhtmlxMessage/codebase/dhtmlxmessage.js",
    "dhtmlxwindows": "./src/dhtmlxWindows/codebase/dhtmlxwindows.js"
  },
  "browserify-shim": {
    "dhtmlxcontainer":  { "exports": ["dhtmlXCellTop", "dhtmlXCellObject"]},      
    "dhtmlxform":       { "exports": "dhtmlXForm"},
    "dhtmlxlayout":     { "exports": "dhtmlXLayoutObject", "depends": [ "dhtmlxcontainer:dhtmlXCellTop", "dhtmlxcontainer:dhtmlXCellObject"] },
    "dhtmlxlist":       { "exports": "dhtmlXList"},
    "dhtmlxmessage":    { "exports": "dhtmlx"},
    "dhtmlxwindows":    { "exports": "dhtmlXWindows", "depends": [ "dhtmlxcontainer:dhtmlXContainer" ] }
  }```
bendrucker commented 7 years ago

browserify-shim does not support multiple exports https://github.com/thlorenz/browserify-shim/issues/122