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

Windows support #5

Open
handrews opened this issue Apr 30, 2018 · 2 comments
Open

Windows support #5

handrews opened this issue Apr 30, 2018 · 2 comments

Comments

@handrews
Copy link
Contributor

The new @cloudflare/doca probably doesn't work any better on Windows than the old.

  • require paths in schema.js use forward slashes
  • when generating form data file upload curl examples, the syntax is different on Windows
  • commands in build and build:nojsare not Windows-friendly, per @wiggisser in @cloudflare/docaBump handlebars from 4.0.11 to 4.7.6 #25:

You must set an environment variable by set SOMEVAR=value. Further more this is a separete command so you'll have to add an additional && before the call to webpack like for instance

"cleanwin": "rmdir /S /Q build",
"buildwin": "npm run cleanwin && set NODE_ENV=production && webpack --config webpack/config.prod.withjs.babel.js && del build\\static-*", 
"buildwin:nojs": "npm run cleanwin set && NODE_ENV=production && webpack --config webpack/config.prod.nojs.babel.js && del build\\static-* && del build\\app-*.js"

From @aphilaja in cloudflare/doca#26:

I don't think Windows build has to be a special case:

use rimraf module instead of del and rm -rf.
use webpack -p instead of NODE_ENV=production
Then it should works equally in win & *nix.

Edit: Hmm.. not sure if -p sets NODE_ENV to production. If that's not the case and the env var is needed, I think there is Webpack plugin for it.

@zhangyongjing
Copy link

'cross-env' can solve the NODE_ENV issue, - by installing 'cross-env' and add 'cross-env' before 'NODE_ENV'. But one still needs to manually fix require paths with forward slashes in 'schema.js'.

@handrews
Copy link
Contributor Author

Thanks, @zhangyongjing !

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

2 participants