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

NODE_ENV=production warning when "parcel watch ..." #2011

Closed
marek-hanzal opened this issue Sep 13, 2018 · 1 comment
Closed

NODE_ENV=production warning when "parcel watch ..." #2011

marek-hanzal opened this issue Sep 13, 2018 · 1 comment

Comments

@marek-hanzal
Copy link

💬 RFC

In short: when somehow environment variable NODE_ENV is set to production, command parcel watch ... builds the stuff and ends immediately which is quite strange behavior and it's not documented (or I've overlooked it :) ). Also when dev server is started, rebuilding is just done one time.

Proposal is to add this behavior to the doc (in some bold) or at least provide some warning in watch and serve command OR normalize behavior, thus watch will not be affected - it will still run, just it could build for the target environment (prod/dev/whatever/...)

🔦 Context

I've used Docker image which provides by default NODE_ENV=production and I was wondering, why parcel is not watching :).

💻 Examples

/frontend/client # npm run watch

> [email protected] watch /frontend/client
> parcel watch -d public src/index.pug

🚨 Warning: NODE_ENV is set to production!

✨  Built in 168ms.

public/css.248f34a3.css    154.18 KB     95ms
public/js.79819611.map      12.99 KB      7ms
public/js.79819611.js       11.25 KB    123ms
public/css.9d99e4d2.js       4.52 KB    122ms
public/css.9d99e4d2.map      2.81 KB      7ms
public/index.html              441 B     11ms
/frontend/client #
@DeMoorJasper
Copy link
Member

This should probably get fixed, parcel should not be affected by node env only the output should

Sent with GitHawk

DeMoorJasper pushed a commit that referenced this issue Sep 17, 2018
---
name: 🙋 fix for watch not working when NODE_ENV is 'production'
about: fixes issue #2011 
---

<!---
Thanks for filing a pull request 😄 ! Before you submit, please read the following:

Search open/closed issues before submitting since someone might have pushed the same thing before!
-->
## ↪️ Pull Request
<!---
Provide a general summary of the pull request here
Does this address an existing issue?
-->
I understand that Parcel should watch changes every time the watch command is being used.
Previously, watch was enabled on dev environment only, while the watch command inserted by users was completely ignored.

With this modification, watch is always enabled if the user passes the command in CLI. 
## 💻 Examples

There is an example in #2011 - first post

## ✔️ PR Todo

- [ ] Added/updated unit tests for this change
- [ ] Filled out test instructions
- [ ] Included links to related issues/PRs
<!-- Love parcel? Please consider supporting our collective:
👉  https://opencollective.com/parcel/donate -->
devongovett pushed a commit that referenced this issue Oct 15, 2018
---
name: 🙋 fix for watch not working when NODE_ENV is 'production'
about: fixes issue #2011 
---

<!---
Thanks for filing a pull request 😄 ! Before you submit, please read the following:

Search open/closed issues before submitting since someone might have pushed the same thing before!
-->
## ↪️ Pull Request
<!---
Provide a general summary of the pull request here
Does this address an existing issue?
-->
I understand that Parcel should watch changes every time the watch command is being used.
Previously, watch was enabled on dev environment only, while the watch command inserted by users was completely ignored.

With this modification, watch is always enabled if the user passes the command in CLI. 
## 💻 Examples

There is an example in #2011 - first post

## ✔️ PR Todo

- [ ] Added/updated unit tests for this change
- [ ] Filled out test instructions
- [ ] Included links to related issues/PRs
<!-- Love parcel? Please consider supporting our collective:
👉  https://opencollective.com/parcel/donate -->
devongovett pushed a commit that referenced this issue Oct 15, 2018
---
name: 🙋 fix for watch not working when NODE_ENV is 'production'
about: fixes issue #2011 
---

<!---
Thanks for filing a pull request 😄 ! Before you submit, please read the following:

Search open/closed issues before submitting since someone might have pushed the same thing before!
-->
## ↪️ Pull Request
<!---
Provide a general summary of the pull request here
Does this address an existing issue?
-->
I understand that Parcel should watch changes every time the watch command is being used.
Previously, watch was enabled on dev environment only, while the watch command inserted by users was completely ignored.

With this modification, watch is always enabled if the user passes the command in CLI. 
## 💻 Examples

There is an example in #2011 - first post

## ✔️ PR Todo

- [ ] Added/updated unit tests for this change
- [ ] Filled out test instructions
- [ ] Included links to related issues/PRs
<!-- Love parcel? Please consider supporting our collective:
👉  https://opencollective.com/parcel/donate -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants