Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"npm run build" overwrites source code #16

Open
rojlarge opened this issue Mar 15, 2016 · 8 comments
Open

"npm run build" overwrites source code #16

rojlarge opened this issue Mar 15, 2016 · 8 comments

Comments

@rojlarge
Copy link

In looking at prepping the COI code for a Production-like environment, it doesn't look like there's a great way to package the server-side javascript code up for deployment without using babel-node. The current build script in package.json overwrites the source code with the transpiled output from Babel, which is pretty inconvenient.

Could the build script be changed to output to a build/ or dist/ folder to avoid this? Something like:

"babel . --ignore "./client/,./node_modules,./loadtest,./webpack.config.js,./test" -d build"

instead of

"babel . --ignore "./client/,./node_modules,./loadtest,./webpack.config.js,./test" -d ."

@iambrandonn
Copy link
Collaborator

Why don't you want to deploy the transpiled code?

@rojlarge
Copy link
Author

We can certainly make do with that, it just seems unnecessarily dangerous to default to overwriting source code in-place. If it doesn't bother anyone else to do it this way then we can just add a step in our deployment process to do the transpilation, I just found it unexpected.

@iambrandonn
Copy link
Collaborator

Gotcha. There's an assumption that the code being transpiled has just been freshly cloned and doesn't contain any "works in progress".

@rojlarge
Copy link
Author

Fair enough. I'm fine with leaving it as-is then, although I think it would definitely be helpful to have some additional documentation on the Production-style build process so that everyone's aware of those assumptions. Right now only running via "npm start" is covered, so just letting everyone know that they should do something else for real deployments would be a big help.

@gouldner
Copy link

I find this confusing as well. When I check github status it tells me I have modified the code. I can easily see a dev committing the transpiled code into github my mistake. Is there a way to let the transpiled code get create in a different folder that can be added to gitignore ?

+1 on better documentation for both dev and prod modes also !

@gouldner
Copy link

gouldner commented Apr 2, 2016

Still no production build and deploy instructions in 1603. Should I open a support ticket on this instead ?

@tdurkin
Copy link
Contributor

tdurkin commented Apr 13, 2016

@gouldner & @rojlarge - The next release will have a new npm run build option for build_babel_to which takes a parameter for target output directory. It's very similar to what Jeff has in his first comment. The release will also have more documentation around the different run options and guidance on which to use for development versus prod.

@rojlarge
Copy link
Author

Thanks Terry! I'll keep an eye out for that in the 1604 release-- that sounds like what I was looking for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants