Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

possibility to disable envify for selected files? #47

Open
leiyangyou opened this issue Dec 29, 2016 · 3 comments
Open

possibility to disable envify for selected files? #47

leiyangyou opened this issue Dec 29, 2016 · 3 comments

Comments

@leiyangyou
Copy link

this particular string

  return '\n    If you using \'express-graphql\', you may get server stack-trace for error.\n    Just tune \'formatError\' to return \'stack\' with stack-trace:\n\n    import graphqlHTTP from \'express-graphql\';\n\n    const graphQLMiddleware = graphqlHTTP({\n      schema: myGraphQLSchema,\n      formatError: (error) => ({\n        message: error.message,\n        stack: process.env.NODE_ENV === \'development\' ? error.stack.split(\'\\n\') : null,\n      })\n    });\n\n    app.use(\'/graphql\', graphQLMiddleware);';

when envified will break acorn as process.env.NODE_ENV is getting changed to 'development'

@shvaikalesh
Copy link
Contributor

Hi @leiyangyou. Thanks for reaching out.

Can you please try to replace process.env.NODE_ENV with process.env['NODE_ENV']. Does it help?

@leiyangyou
Copy link
Author

leiyangyou commented Dec 30, 2016 via email

@shvaikalesh
Copy link
Contributor

shvaikalesh commented Dec 31, 2016

That's exactly what I ended up doing, although it meant that I had to clone and modify a third party library.

That sucks.

Indeed, we will integrate AST-based solution, cause we have too many issues caused by the current one.

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

No branches or pull requests

2 participants