Saturday, 29 April 2017

Node Package Manager Failing on Browserify Script

There are lots of moving parts for this question so I will post everything. I am running npm run build and I get the following:

enter image description here

Here is my build script in package.json file:

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build":"browserify -d app/scripts/src/main.js -o app/scripts/dist/main.js" 
  },
  "browserify":{
    "transform":[
      "babelify",{"presets":["es2015"],"sourceMap":true}
    ]
  },

app.js:

class ChatApp {
  constructor() {
    console.log("Hello World")
  }
}
 export default ChatApp 

main.js:

import ChatApp from './app'
new ChatApp()

Node version: 6.9.4

Browserify version: 14.3.0



via john doe

No comments:

Post a Comment