Closed Maushundb closed 7 years ago
that's not webpack. it's babel transpiling the bootstrap code. it also just happens to have the api.
use this instead:
https://babeljs.io/docs/usage/cli/#babel-compile-directories
it should be this:
"build:node": "cross-env NODE_ENV=production babel server -d buildServer --ignore configureStore,render",
feel free to PR
Hey spacey, it seems like in your package.json, you manually transpile all the dependencies of index.js:
build:node": "cross-env NODE_ENV=production babel server/index.js -o buildServer/index.js && babel server/api.js -o buildServer/api.js",
Given that you use
api.js
in setting up your server.I might just be a WebPack noob, but it there a proper way to set up this script to compile an arbitrary dependency graph used by your node server? I ask because I am trying to set up an endpoint that queries a database, which has it's own intricate dependency graph. For example, this script errors when I try adding the following in
server/index.js
:Thanks dude!