Skip to content

Instantly share code, notes, and snippets.

@SudoPlz
Created December 9, 2015 13:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SudoPlz/25c42cabb22910378298 to your computer and use it in GitHub Desktop.
Save SudoPlz/25c42cabb22910378298 to your computer and use it in GitHub Desktop.
"scripts": {
"debugMode":"parallelshell 'npm run webpack-node' 'npm run webpack-server-browser'",
"start": "parallelshell 'npm run webpack-node' 'npm run webpack-server-browser' 'npm run nodemon'",
"nodemon":"sleep 16;nodemon bin/serverEntryPoint.js",
"webpack-server-browser":"./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config ./webpack.browser.config.js --hot --port 8081",
"webpack-node":"./node_modules/webpack/bin/webpack.js --config ./webpack.node.config.js --progress --watch",
"lint":"eslint app/ -c .eslintrc",
"moveJs":"cp node_modules/marty-clipboard/dist/marty-clipboard.js dist/javascripts/",
"moveCss":"cp node_modules/react-bootstrap-modal/lib/styles/rbm-complete.css app/styles/"
}
@ateev
Copy link

ateev commented Dec 12, 2015

Thanks for sharing this. This saved my hours.

I also created two webpack files. And the server one did build successfully. But It's giving errors when trying to run.
I created file bin/main.js via webpack. Now when i'm doing node start bin/main.js, it's throwing weird error

main-2 Error: Cannot find module '/Users/ateev/project/main.js'
main-2     at Function.Module._resolveFilename (module.js:336:15)
main-2     at Function.Module._load (module.js:286:25)
main-2     at Function._load (/usr/local/lib/node_modules/pm2/node_modules/pmx/lib/transaction.js:62:21)
main-2     at Object.<anonymous> (/usr/local/lib/node_modules/pm2/lib/ProcessContainerFork.js:28:21)
main-2     at Module._compile (module.js:434:26)
main-2     at Object.Module._extensions..js (module.js:452:10)
main-2     at Module.load (module.js:355:32)
main-2     at Function.Module._load (module.js:310:12)
main-2     at Function.Module.runMain (module.js:475:10)
main-2     at startup (node.js:118:18)

Any Idea why its looking for main.js in root folder instead of bin folder ? I searched everywhere, I havn't required this anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment