simplifyify icon indicating copy to clipboard operation
simplifyify copied to clipboard

simplifyify fails to pick browserify-shim out of package.json

Open cfv1984 opened this issue 9 years ago • 3 comments

This block:

  "main": "js/src/app/bootstrap.js",
  "browserify": {
    "transform": [
      "browserify-shim"
    ]
  },
  "browserify-shim": {
    "./js/vendor/history.js": "history",
    "./js/vendor/bluebird/js/browser/bluebird.js": "bluebird"
  }

Generates a proper JS when using browserify 13.0.0 , but fails when using simplifyify, with message:

Error reading Browserify transforms for js/src/App/bootstrap.js
Cannot find module 'browserify-shim'
```. What am I doing wrong exactly? 

cfv1984 avatar Apr 12 '16 17:04 cfv1984

Do you have browserify-shim installed? Based on the error message, it sounds like it can't find it the node_modules folder.

JamesMessinger avatar Apr 13 '16 17:04 JamesMessinger

Browserify is picking the shim just fine from what I'm seeing in the result JS On 13 Apr 2016 14:12, "James Messinger" [email protected] wrote:

Do you have browserify-shim installed? Based on the error message, it sounds like it can't find it the node_modules folder.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/BigstickCarpet/simplifyify/issues/8#issuecomment-209549829

cfv1984 avatar Apr 13 '16 17:04 cfv1984

I think your problem may be similar to one I had today when using a command line to bundle files in my project/client/scr directory. The command line was issued from the /project directory where the main package.json also resided. I also had a package.json in my /project/client directory. I believe simplifyify starts looking for a package.json starting at /project/client/scr in my case and walks up the directory structure until it finds one. So it found and used the one in my /project/client directory instead of the one in /project. This caused my babelify transform not to be run as I had the entry in the /project/package.json not the /project/client/project.json. Hope this helps.

ghost avatar Apr 13 '16 21:04 ghost